- Generic automake cleanup
[ganeti-local] / scripts / gnt-backup
index aba46a4..6a86770 100755 (executable)
@@ -38,7 +38,6 @@ def PrintExportList(opts, args):
     nothing
 
   """
-
   op = opcodes.OpQueryExports(nodes=opts.nodes)
   exports = SubmitOpCode(op)
   for node in exports:
@@ -83,14 +82,14 @@ def ImportInstance(opts, args):
     1 in case of error, 0 otherwise
 
   """
-
   instance = args[0]
 
   op = opcodes.OpCreateInstance(instance_name=instance, mem_size=opts.mem,
                                 disk_size=opts.size, swap_size=opts.swap,
                                 disk_template=opts.disk_template,
-                                mode=constants.INSTANCE_IMPORT, pnode=opts.node,
-                                snode=opts.snode, vcpus=opts.vcpus,
+                                mode=constants.INSTANCE_IMPORT,
+                                pnode=opts.node, snode=opts.snode,
+                                vcpus=opts.vcpus,
                                 ip=opts.ip, bridge=opts.bridge, start=False,
                                 src_node=opts.src_node, src_path=opts.src_dir,
                                 wait_for_sync=opts.wait_for_sync)
@@ -101,8 +100,6 @@ def ImportInstance(opts, args):
 # options used in more than one cmd
 node_opt = make_option("-n", "--node", dest="node", help="Target node",
                        metavar="<node>")
-force_opt = make_option("-f", "--force", dest="force", action="store_true",
-                        default=False, help="Force the operation")
 
 # this is defined separately due to readability only
 import_opts = [
@@ -136,7 +133,6 @@ import_opts = [
               metavar="<dir>"),
   ]
 
-
 commands = {
   'list': (PrintExportList, ARGS_NONE,
            [DEBUG_OPT,
@@ -145,7 +141,7 @@ commands = {
             ],
            "", "Lists instance exports available in the ganeti cluster"),
   'export': (ExportInstance, ARGS_ONE,
-             [node_opt, DEBUG_OPT, force_opt,
+             [node_opt, DEBUG_OPT, FORCE_OPT,
               make_option("","--noshutdown", dest="shutdown",
                           action="store_false", default=True,
                           help="Don't shutdown the instance (unsafe)"), ],
@@ -156,5 +152,4 @@ commands = {
   }
 
 if __name__ == '__main__':
-  retcode = GenericMain(commands)
-  sys.exit(retcode)
+  sys.exit(GenericMain(commands))