summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton2018-11-09 17:36:56 -0700
committerSean Whitton2018-11-09 17:37:42 -0700
commit06e9cedeb67c75eca4053f873b7ad83a2a00d5a8 (patch)
tree558ebfa7e0ff5f9dda8e27a0cae982dfee9a6f63
parent34e3e27b5bfe8a018381ad630c6f8b477bee6f44 (diff)
note that --os-variant is optional
-rw-r--r--src/Propellor/Property/Libvirt.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs
index de08fcdb..aec9f3c8 100644
--- a/src/Propellor/Property/Libvirt.hs
+++ b/src/Propellor/Property/Libvirt.hs
@@ -140,6 +140,9 @@ defined imageType (MiBMemory mem) (NumVCPUs cpus) auto h =
-- ==== utility functions ====
+-- The --os-variant property is optional, per virt-install(1), so return Nothing
+-- if there isn't a known correct value. The VM will still be defined. Pass
+-- the value if we can, though, to optimise the generated XML for the host's OS
osVariant :: Host -> Maybe String
osVariant h = hostSystem h >>= \s -> case s of
System (Debian _ (Stable "jessie")) _ -> Just "debian8"