summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Hicks <nooneofconsequence@gmail.com>2016-11-29 08:08:39 -0800
committerMichael Hicks <nooneofconsequence@gmail.com>2016-11-29 10:35:38 -0800
commitbb398c941adcce8b7908398aaf55538fbeeb06d1 (patch)
treecddda17bcb4124831a31bde06f403998c77ce4e9 /lib
parentd6eff109cdfabe99ee0be41cba443861bca6d851 (diff)
downloadohai-bb398c941adcce8b7908398aaf55538fbeeb06d1.tar.gz
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 <michael.hicks@joyent.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ohai/plugins/solaris2/virtualization.rb6
1 files changed, 5 insertions, 1 deletions
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"