From af0c84f52bd80da323d565a07b8cee3fd85939b8 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 4 Sep 2019 16:19:17 -0700 Subject: Use the more reliable systems virtualization attribute for Openstack 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 --- spec/unit/plugins/openstack_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec') 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 -- cgit v1.2.1