OpenNebula/one — pull request #32 by opteamax (2014-07-23 15:09:07+00:00)
Title: Exception-Prevention in src/oca/ruby/opennebula/client.rb

- Add validation of ENV['HOME'] before trying to use it in string-concat to prevent nil:NilClass-Exception
- Add default-path check "/var/lib/one/.one" if ENV['HOME'] is not defined

When the ENV-variable 'HOME' is unset (happened e.g. in my puppet rollout), the usage results in an nil:NilClass-Exception, as client.rb tries to concatenate ENV['HOME'] and a string. To prevent this, I patched client.rb to validate if ENV['HOME'] is set. Additionally, I added checking if the looked-up files exist in Default-Installation-Path (/var/lib/one/), if ENV['HOME'] does not exist, or the files don't exist there.