From ee3e37a7012ea9580845bbc6384cd5ac9ba7e78f Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sat, 15 Jan 2011 13:05:50 +0100
Subject: [PATCH] Rename OpShutdownInstance and LUShutdownInstance
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>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/client/gnt_instance.py         | 2 +-
 lib/cmdlib.py                      | 2 +-
 lib/opcodes.py                     | 2 +-
 lib/rapi/rlib2.py                  | 4 ++--
 test/ganeti.rapi.rlib2_unittest.py | 2 +-
 tools/burnin                       | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py
index 187ce7fd3..2b8964b0b 100644
--- a/lib/client/gnt_instance.py
+++ b/lib/client/gnt_instance.py
@@ -718,7 +718,7 @@ def _ShutdownInstance(name, opts):
   @return: the opcode needed for the operation
 
   """
-  return opcodes.OpShutdownInstance(instance_name=name,
+  return opcodes.OpInstanceShutdown(instance_name=name,
                                     timeout=opts.timeout,
                                     ignore_offline_nodes=opts.ignore_offline)
 
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 1a53038a3..6770eda1f 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -5124,7 +5124,7 @@ class LUInstanceReboot(LogicalUnit):
     self.cfg.MarkInstanceUp(instance.name)
 
 
-class LUShutdownInstance(LogicalUnit):
+class LUInstanceShutdown(LogicalUnit):
   """Shutdown an instance.
 
   """
diff --git a/lib/opcodes.py b/lib/opcodes.py
index 6fb285913..198f3616d 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -838,7 +838,7 @@ class OpStartupInstance(OpCode):
     ]
 
 
-class OpShutdownInstance(OpCode):
+class OpInstanceShutdown(OpCode):
   """Shutdown an instance."""
   OP_ID = "OP_INSTANCE_SHUTDOWN"
   OP_DSC_FIELD = "instance_name"
diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py
index 96594b4bd..098da3831 100644
--- a/lib/rapi/rlib2.py
+++ b/lib/rapi/rlib2.py
@@ -1013,7 +1013,7 @@ class R_2_instances_name_shutdown(baserlib.R_Generic):
 
     """
     instance_name = self.items[0]
-    op = opcodes.OpShutdownInstance(instance_name=instance_name,
+    op = opcodes.OpInstanceShutdown(instance_name=instance_name,
                                     dry_run=bool(self.dryRun()))
 
     return baserlib.SubmitJob([op])
@@ -1032,7 +1032,7 @@ def _ParseInstanceReinstallRequest(name, data):
   osparams = baserlib.CheckParameter(data, "osparams", default=None)
 
   ops = [
-    opcodes.OpShutdownInstance(instance_name=name),
+    opcodes.OpInstanceShutdown(instance_name=name),
     opcodes.OpInstanceReinstall(instance_name=name, os_type=ostype,
                                 osparams=osparams),
     ]
diff --git a/test/ganeti.rapi.rlib2_unittest.py b/test/ganeti.rapi.rlib2_unittest.py
index d010018ef..fc0158cae 100755
--- a/test/ganeti.rapi.rlib2_unittest.py
+++ b/test/ganeti.rapi.rlib2_unittest.py
@@ -366,7 +366,7 @@ class TestParseInstanceReinstallRequest(testutils.GanetiTestCase):
 
   def _Check(self, ops, name):
     expcls = [
-      opcodes.OpShutdownInstance,
+      opcodes.OpInstanceShutdown,
       opcodes.OpInstanceReinstall,
       opcodes.OpStartupInstance,
       ]
diff --git a/tools/burnin b/tools/burnin
index 3a68610d1..1c493ed1f 100755
--- a/tools/burnin
+++ b/tools/burnin
@@ -752,7 +752,7 @@ class Burner(object):
   @staticmethod
   def StopInstanceOp(instance):
     """Stop given instance."""
-    return opcodes.OpShutdownInstance(instance_name=instance)
+    return opcodes.OpInstanceShutdown(instance_name=instance)
 
   @staticmethod
   def StartInstanceOp(instance):
-- 
GitLab