build/import: Add --no-start flag.
[mclu.git] / mclu_import.py
index 46797d0..7a019ba 100644 (file)
@@ -44,6 +44,10 @@ def cmdline (subparsers):
         help='use virtio disks and network'
     )
     p.add_argument (
+        '--no-start', action='store_const', const=True,
+        help='do not start the guest after importing'
+    )
+    p.add_argument (
         'name',
         help='name of the new VM (or use "vm:name")'
     )
@@ -98,6 +102,7 @@ def run (c, args):
     fp.write (xml)
     fp.close ()
 
-    # Start the guest.
-    lib.start_guest (c, node_name, vm_name)
-    print "guest imported and started on node %s" % node_name
+    if not args.no_start:
+        # Start the guest.
+        lib.start_guest (c, node_name, vm_name)
+        print "guest started on node %s" % node_name