diff options
-rw-r--r-- | lib/ohai/plugins/cloud.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/openstack.rb | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/ohai/plugins/cloud.rb b/lib/ohai/plugins/cloud.rb index 0bb2efe0..a189541b 100644 --- a/lib/ohai/plugins/cloud.rb +++ b/lib/ohai/plugins/cloud.rb @@ -169,7 +169,7 @@ def get_openstack_values cloud[:public_hostname] = openstack['public_hostname'] cloud[:local_ipv4] = openstack['local_ipv4'] cloud[:local_hostname] = openstack['local_hostname'] - cloud[:provider] = "openstack" + cloud[:provider] = openstack['provider'] end # setup openstack cloud diff --git a/lib/ohai/plugins/openstack.rb b/lib/ohai/plugins/openstack.rb index 949c7c4e..d6b0f31a 100644 --- a/lib/ohai/plugins/openstack.rb +++ b/lib/ohai/plugins/openstack.rb @@ -25,13 +25,21 @@ extend Ohai::Mixin::Ec2Metadata #Ec2Metadata::EC2_METADATA_URL = "/latest/meta-data" # Adds openstack Mash -if hint?('openstack') +if hint?('openstack') || hint?('hp') Ohai::Log.debug("ohai openstack") openstack Mash.new #for now, use the metadata service if can_metadata_connect?(EC2_METADATA_ADDR,80) Ohai::Log.debug("connecting to the OpenStack metadata service") self.fetch_metadata.each {|k, v| openstack[k] = v } + case + when hint?('hp') + openstack['provider'] = 'hp' + when hint?('rackspace') + openstack['provider'] = 'rackspace' + else + openstack['provider'] = 'openstack' + end else Ohai::Log.debug("unable to connect to the OpenStack metadata service") end |