Fix a broken commandline switch option
[ganeti-local] / scripts / gnt-backup
index e037035..b7e49d1 100755 (executable)
@@ -71,10 +71,14 @@ def ExportInstance(opts, args):
   @return: the desired exit code
 
   """
+  ignore_remove_failures = opts.ignore_remove_failures
+
   op = opcodes.OpExportInstance(instance_name=args[0],
                                 target_node=opts.node,
                                 shutdown=opts.shutdown,
-                                shutdown_timeout=opts.shutdown_timeout)
+                                shutdown_timeout=opts.shutdown_timeout,
+                                remove_instance=opts.remove_instance,
+                                ignore_remove_failures=ignore_remove_failures)
 
   fin_resu, dlist = SubmitOpCode(op, opts=opts)
   if not isinstance(dlist, list):
@@ -97,6 +101,7 @@ def ExportInstance(opts, args):
     rcode = 1
   return rcode
 
+
 def ImportInstance(opts, args):
   """Add an instance to the cluster.
 
@@ -139,12 +144,14 @@ import_opts = [
   NONAMECHECK_OPT,
   NONICS_OPT,
   NWSYNC_OPT,
+  OSPARAMS_OPT,
   OS_SIZE_OPT,
   SRC_DIR_OPT,
   SRC_NODE_OPT,
   SUBMIT_OPT,
   ]
 
+
 commands = {
   'list': (
     PrintExportList, ARGS_NONE,
@@ -152,7 +159,8 @@ commands = {
     "", "Lists instance exports available in the ganeti cluster"),
   'export': (
     ExportInstance, ARGS_ONE_INSTANCE,
-    [FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT],
+    [FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT,
+     REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT],
     "-n <target_node> [opts...] <name>",
     "Exports an instance to an image"),
   'import': (