From bb398c941adcce8b7908398aaf55538fbeeb06d1 Mon Sep 17 00:00:00 2001 From: Michael Hicks Date: Tue, 29 Nov 2016 08:08:39 -0800 Subject: fix for #891 to detect the global zone of a Solaris system as a Virt host even when not currently hosting any guests Signed-off-by: Michael Hicks --- lib/ohai/plugins/solaris2/virtualization.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ohai/plugins/solaris2/virtualization.rb b/lib/ohai/plugins/solaris2/virtualization.rb index bca7b6eb..8aade938 100644 --- a/lib/ohai/plugins/solaris2/virtualization.rb +++ b/lib/ohai/plugins/solaris2/virtualization.rb @@ -74,7 +74,11 @@ Ohai.plugin(:Virtualization) do if zones.length == 1 first_zone = zones.keys[0] - unless first_zone == "global" + if( first_zone == "global") + virtualization[:system] = "zone" + virtualization[:role] = "host" + virtualization[:systems][:zone] = "host" + else virtualization[:system] = "zone" virtualization[:role] = "guest" virtualization[:systems][:zone] = "guest" -- cgit v1.2.1