diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-09-04 16:19:17 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-09-04 16:19:17 -0700 |
commit | af0c84f52bd80da323d565a07b8cee3fd85939b8 (patch) | |
tree | 80dba2e40d15523584b1fdaf11c00b04838415bf /spec | |
parent | 20032b91d18b8534e99c4181f4bda8e4d8c84a37 (diff) | |
download | ohai-af0c84f52bd80da323d565a07b8cee3fd85939b8.tar.gz |
Use the more reliable systems virtualization attribute for Openstackopenstack_ohaii
If we're on openstack we'll have this even if the order of detection doesn't make it the main virt platform.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/openstack_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/plugins/openstack_spec.rb b/spec/unit/plugins/openstack_spec.rb index bbfe6a5b..cb67402a 100644 --- a/spec/unit/plugins/openstack_spec.rb +++ b/spec/unit/plugins/openstack_spec.rb @@ -26,7 +26,7 @@ describe Ohai::System, "plugin openstack" do before do PasswdEntry = Struct.new(:name, :uid, :gid, :dir, :shell, :gecos) allow(plugin).to receive(:hint?).with("openstack").and_return(false) - plugin[:virtualization] = { system: {} } + plugin[:virtualization] = { systems: {} } end context "when there is no relevant hint or virtualization data" do @@ -42,7 +42,7 @@ describe Ohai::System, "plugin openstack" do allow(plugin).to receive(:can_socket_connect?) .with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80, default_timeout) .and_return(false) - plugin[:virtualization] = { system: { guest: "openstack" } } + plugin[:virtualization] = { systems: { openstack: "guest" } } expect(Etc).to receive(:getpwnam).and_raise(ArgumentError) plugin.run end @@ -63,7 +63,7 @@ describe Ohai::System, "plugin openstack" do allow(plugin).to receive(:can_socket_connect?) .with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80, default_timeout) .and_return(false) - plugin[:virtualization] = { system: { guest: "openstack" } } + plugin[:virtualization] = { systems: { openstack: "guest" } } expect(Etc).to receive(:getpwnam).and_return(PasswdEntry.new("dhc-user", 800, 800, "/var/www", "/bin/false", "The dreamhost user")) plugin.run expect(plugin[:openstack][:provider]).to eq("dreamhost") @@ -295,7 +295,7 @@ describe Ohai::System, "plugin openstack" do allow(plugin).to receive(:can_socket_connect?) .with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80, default_timeout) .and_return(false) - plugin[:virtualization] = { system: { guest: "openstack" } } + plugin[:virtualization] = { systems: { openstack: "guest" } } plugin.run end |