From 4ff922a2f9b550323f421d2baca26ca24ac7309f Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sat, 15 Jan 2011 12:55:30 +0100
Subject: [PATCH] Rename OpExportInstance and LUExportInstance
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 doc/design-2.2.rst                 |  4 ++--
 lib/client/gnt_backup.py           | 14 +++++++-------
 lib/cmdlib.py                      |  2 +-
 lib/opcodes.py                     |  2 +-
 lib/rapi/rlib2.py                  | 18 +++++++++---------
 test/ganeti.rapi.rlib2_unittest.py |  4 ++--
 tools/burnin                       | 10 +++++-----
 7 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/doc/design-2.2.rst b/doc/design-2.2.rst
index 162848ab0..1eb0ee3e5 100644
--- a/doc/design-2.2.rst
+++ b/doc/design-2.2.rst
@@ -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
diff --git a/lib/client/gnt_backup.py b/lib/client/gnt_backup.py
index c154ae8fb..f0acea940 100644
--- a/lib/client/gnt_backup.py
+++ b/lib/client/gnt_backup.py
@@ -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
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 76a892228..dd0ef806d 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -9581,7 +9581,7 @@ class LUPrepareExport(NoHooksLU):
     return None
 
 
-class LUExportInstance(LogicalUnit):
+class LUBackupExport(LogicalUnit):
   """Export an instance to an image in the cluster.
 
   """
diff --git a/lib/opcodes.py b/lib/opcodes.py
index 6d073fcaf..6d9377314 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -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
diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py
index 499f9329a..a4747b2ae 100644
--- a/lib/rapi/rlib2.py
+++ b/lib/rapi/rlib2.py
@@ -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):
diff --git a/test/ganeti.rapi.rlib2_unittest.py b/test/ganeti.rapi.rlib2_unittest.py
index 9c08ab2b0..e3cf6e9f1 100755
--- a/test/ganeti.rapi.rlib2_unittest.py
+++ b/test/ganeti.rapi.rlib2_unittest.py
@@ -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)
diff --git a/tools/burnin b/tools/burnin
index 2f48193b9..5324ba8b5 100755
--- a/tools/burnin
+++ b/tools/burnin
@@ -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)
-- 
GitLab