summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Whitton2018-11-10 19:58:32 -0700
committerSean Whitton2018-11-10 19:58:32 -0700
commit31e2c1ba6707acfedbb12f5d21c8d519b65cd2e2 (patch)
treea56cf3817e95edaa1cfce57a57aad67f343d7299 /src
parent54575585fd0afd895ac522bd24926087313332db (diff)
avoid passing an empty arg when the OS variant is unknown, too
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Libvirt.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs
index eae63f18..525dd68a 100644
--- a/src/Propellor/Property/Libvirt.hs
+++ b/src/Propellor/Property/Libvirt.hs
@@ -121,14 +121,13 @@ defined imageType (MiBMemory mem) (NumVCPUs cpus) auto h =
withTmpFile (hostName h) $ \t fh -> do
xml <- liftIO $ readProcess "virt-install" $
[ "-n", hostName h
- , osVariantArg
, "--memory=" ++ show mem
, "--vcpus=" ++ show cpus
, "--disk"
, "path=" ++ imageLoc
++ ",device=disk,bus=virtio"
, "--print-xml"
- ] ++ autoStartArg
+ ] ++ autoStartArg ++ osVariantArg
liftIO $ hPutStrLn fh xml
liftIO $ hClose fh
makeChange $ unlessM (defineIt t) $
@@ -158,7 +157,7 @@ defined imageType (MiBMemory mem) (NumVCPUs cpus) auto h =
Raw -> "img"
conf = "/etc/libvirt/qemu" </> hostName h <.> "xml"
- osVariantArg = maybe "" ("--os-variant=" ++) $ osVariant h
+ osVariantArg = maybe [] (\v -> ["--os-variant=" ++ v]) $ osVariant h
autoStartArg = case auto of
AutoStart -> ["--autostart"]
NoAutoStart -> []