opscode/ohai — pull request #173 by grahamc (2013-08-14 15:50:12+00:00)
Title: [OHAI-499] If the public IP is nil, don't attempt to set a cloud-ips.com based hostname.

The public_hostname attribute is populated based on the detected public IP. Since the IP is manipulated with gsub, it throws an exception.
jj
Expected `rackspace` attribute value:

```
{ "private_ip": "xxx.xxx.xxx.xxx", "region": "ord", "public_ipv4": null, "public_hostname: null, "local_ipv4": "xxx.xxx.xxx.xxx", "local_hostname": "xxxxx" }
```

Actual `rackspace` attribute value:

```
{ "private_ip": "xxx.xxx.xxx.xxx", "region": "ord", "public_ipv4": null }
```

Stack trace:

```
[2013-08-14T10:42:10-05:00] DEBUG: Plugin rackspace threw exception # /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/plugins/rackspace.rb:106:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/mixin/from_file.rb:29:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/mixin/from_file.rb:29:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:216:in `block in require_plugin'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:211:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:211:in `require_plugin'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:140:in `block (2 levels) in all_plugins'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:133:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:133:in `block in all_plugins'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:131:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/system.rb:131:in `all_plugins'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/application.rb:97:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/lib/ohai/application.rb:75:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.18.0/bin/ohai:51:in `'
/usr/bin/ohai:23:in `load'
/usr/bin/ohai:23:in `

'
```