Rename OpExportInstance and LUExportInstance
authorIustin Pop <iustin@google.com>
Sat, 15 Jan 2011 11:55:30 +0000 (12:55 +0100)
committerIustin Pop <iustin@google.com>
Tue, 18 Jan 2011 11:47:10 +0000 (12:47 +0100)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

doc/design-2.2.rst
lib/client/gnt_backup.py
lib/cmdlib.py
lib/opcodes.py
lib/rapi/rlib2.py
test/ganeti.rapi.rlib2_unittest.py
tools/burnin

index 162848a..1eb0ee3 100644 (file)
@@ -329,7 +329,7 @@ Workflow
 
    - The destination cluster generates another key and certificate,
      signs and sends it to the third party, who will have to pass it to
-     the API for exporting an instance (``OpExportInstance``). This
+     the API for exporting an instance (``OpBackupExport``). This
      certificate is used to ensure we're sending the disk data to the
      correct destination cluster.
    - Once a disk can be imported, the API sends the destination
@@ -340,7 +340,7 @@ Workflow
    together with all necessary information to source cluster and tells
    it to start the move
 
-   - The existing API for exporting instances (``OpExportInstance``)
+   - The existing API for exporting instances (``OpBackupExport``)
      will be extended to export instances to remote clusters.
 
 #. Source cluster connects to destination cluster for each disk and
index c154ae8..f0acea9 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -76,12 +76,12 @@ def ExportInstance(opts, args):
     raise errors.OpPrereqError("Target node must be specified",
                                errors.ECODE_INVAL)
 
-  op = opcodes.OpExportInstance(instance_name=args[0],
-                                target_node=opts.node,
-                                shutdown=opts.shutdown,
-                                shutdown_timeout=opts.shutdown_timeout,
-                                remove_instance=opts.remove_instance,
-                                ignore_remove_failures=ignore_remove_failures)
+  op = opcodes.OpBackupExport(instance_name=args[0],
+                              target_node=opts.node,
+                              shutdown=opts.shutdown,
+                              shutdown_timeout=opts.shutdown_timeout,
+                              remove_instance=opts.remove_instance,
+                              ignore_remove_failures=ignore_remove_failures)
 
   SubmitOpCode(op, opts=opts)
   return 0
index 76a8922..dd0ef80 100644 (file)
@@ -9581,7 +9581,7 @@ class LUPrepareExport(NoHooksLU):
     return None
 
 
-class LUExportInstance(LogicalUnit):
+class LUBackupExport(LogicalUnit):
   """Export an instance to an image in the cluster.
 
   """
index 6d073fc..6d93773 100644 (file)
@@ -1113,7 +1113,7 @@ class OpPrepareExport(OpCode):
     ]
 
 
-class OpExportInstance(OpCode):
+class OpBackupExport(OpCode):
   """Export an instance.
 
   For local exports, the export destination is the node name. For remote
index 499f932..a4747b2 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1163,7 +1163,7 @@ class R_2_instances_name_prepare_export(baserlib.R_Generic):
 def _ParseExportInstanceRequest(name, data):
   """Parses a request for an instance export.
 
-  @rtype: L{opcodes.OpExportInstance}
+  @rtype: L{opcodes.OpBackupExport}
   @return: Instance export opcode
 
   """
@@ -1177,13 +1177,13 @@ def _ParseExportInstanceRequest(name, data):
   destination_x509_ca = baserlib.CheckParameter(data, "destination_x509_ca",
                                                 default=None)
 
-  return opcodes.OpExportInstance(instance_name=name,
-                                  mode=mode,
-                                  target_node=target_node,
-                                  shutdown=shutdown,
-                                  remove_instance=remove_instance,
-                                  x509_key_name=x509_key_name,
-                                  destination_x509_ca=destination_x509_ca)
+  return opcodes.OpBackupExport(instance_name=name,
+                                mode=mode,
+                                target_node=target_node,
+                                shutdown=shutdown,
+                                remove_instance=remove_instance,
+                                x509_key_name=x509_key_name,
+                                destination_x509_ca=destination_x509_ca)
 
 
 class R_2_instances_name_export(baserlib.R_Generic):
index 9c08ab2..e3cf6e9 100755 (executable)
@@ -196,7 +196,7 @@ class TestParseExportInstanceRequest(testutils.GanetiTestCase):
       "destination_x509_ca": ("x", "y", "z"),
       }
     op = self.Parse(name, data)
-    self.assert_(isinstance(op, opcodes.OpExportInstance))
+    self.assert_(isinstance(op, opcodes.OpBackupExport))
     self.assertEqual(op.instance_name, name)
     self.assertEqual(op.mode, constants.EXPORT_MODE_REMOTE)
     self.assertEqual(op.shutdown, True)
@@ -211,7 +211,7 @@ class TestParseExportInstanceRequest(testutils.GanetiTestCase):
       "shutdown": False,
       }
     op = self.Parse(name, data)
-    self.assert_(isinstance(op, opcodes.OpExportInstance))
+    self.assert_(isinstance(op, opcodes.OpBackupExport))
     self.assertEqual(op.instance_name, name)
     self.assertEqual(op.mode, constants.EXPORT_MODE_LOCAL)
     self.assertEqual(op.remove_instance, False)
index 2f48193..5324ba8 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -711,10 +711,10 @@ class Burner(object):
         import_log_msg = ("import from %s to %s, %s" %
                           (enode, pnode, snode))
 
-      exp_op = opcodes.OpExportInstance(instance_name=instance,
-                                        target_node=enode,
-                                        mode=constants.EXPORT_MODE_LOCAL,
-                                        shutdown=True)
+      exp_op = opcodes.OpBackupExport(instance_name=instance,
+                                      target_node=enode,
+                                      mode=constants.EXPORT_MODE_LOCAL,
+                                      shutdown=True)
       rem_op = opcodes.OpRemoveInstance(instance_name=instance,
                                         ignore_failures=True)
       imp_dir = utils.PathJoin(constants.EXPORT_DIR, full_name)