Created
March 22, 2013 01:23
-
-
Save spheromak/5218256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the proper system type. | |
def system_class | |
virt = node.virtualization | |
if virt[:role] | |
if virt[:role] == "guest" && virt[:system] == "xen" | |
return "xen-guest" | |
elsif virt[:role] == "host" && virt[:system] == "xen" | |
return "xen-host" | |
else | |
return "unknown-vm" | |
end | |
else | |
return "hardware" | |
end | |
end | |
# Assert a system class against the nodes system class | |
def system_class?(arg) | |
return true ? arg == system_class : false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment