cloudfoundry/bosh — pull request #586 by dkoper (2014-05-30 02:39:02+00:00)
Title: added 'rb' to open stemcell in binary to suppress CR/LF conversion on Win

stemcell.rb fails to read tgz'ed stemcell on Windows because it uses Ruby's File.open which defaults to CRLF conversion. This fix adds a 'rb' flag (read binary mode) to suppress the conversion.

Before this patch:

Verifying stemcell...
File exists and readable
Verifying tarball...
Read tarball D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/bosh_cli-1.2549.0/lib/
e': invalid bit length repeat (Zlib::DataError)
from D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/bosh_cli-1.2549.0/lib/cli/stemcell.rb:26:in `new'
from D:/Programs/Ruby193/lib/ruby/gems/1.9.1/gems/bosh_cli-1.2549.0/lib/cli/stemcell.rb:26:in `block in perform_validation

After:

Verifying stemcell...
File exists and readable [0m[32mOK[0m
Verifying tarball...
Read tarball [0m[32mOK[0m
Manifest exists [0m[32mOK[0m
Stemcell image file [0m[32mOK[0m
Stemcell properties [0m[32mOK[0m

Stemcell info
-------------