From e1530b108ddcb5ee84a54f55b8da181ce981fd07 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Sat, 15 Jan 2011 12:56:18 +0100 Subject: [PATCH] Rename OpCreateInstance and LUCreateInstance 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.0.rst | 2 +- doc/design-2.2.rst | 4 ++-- lib/cli.py | 2 +- lib/client/gnt_instance.py | 2 +- lib/cmdlib.py | 2 +- lib/opcodes.py | 2 +- lib/rapi/rlib2.py | 8 ++++---- test/ganeti.rapi.rlib2_unittest.py | 2 +- tools/burnin | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/design-2.0.rst b/doc/design-2.0.rst index c2c4591d8..9723c26f2 100644 --- a/doc/design-2.0.rst +++ b/doc/design-2.0.rst @@ -961,7 +961,7 @@ Opcode changes The parameter changes will have impact on the OpCodes, especially on the following ones: -- ``OpCreateInstance``, where the new hv and be parameters will be sent +- ``OpInstanceCreate``, where the new hv and be parameters will be sent as dictionaries; note that all hv and be parameters are now optional, as the values can be instead taken from the cluster - ``OpQueryInstances``, where we have to be able to query these new diff --git a/doc/design-2.2.rst b/doc/design-2.2.rst index 79163728a..453b17d9a 100644 --- a/doc/design-2.2.rst +++ b/doc/design-2.2.rst @@ -317,7 +317,7 @@ Workflow instance move with the key received from the source cluster and receives the public part of the destination's encryption key - - The current API to create instances (``OpCreateInstance``) will be + - The current API to create instances (``OpInstanceCreate``) will be extended to support an import from a remote cluster. - A valid, unexpired X509 certificate signed with the destination cluster's secret will be required. By verifying the signature, we @@ -725,7 +725,7 @@ unless the hidden state is requested. For the blacklisted OSes, they are also not shown (unless the blacklisted state is requested), and they are also prevented from -installation via ``OpCreateInstance`` (in create mode). +installation via ``OpInstanceCreate`` (in create mode). Both these attributes are per-OS, not per-variant. Thus they apply to all of an OS' variants, and it's impossible to blacklist or hide just diff --git a/lib/cli.py b/lib/cli.py index 0eb51d0d0..6edd7b643 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -2054,7 +2054,7 @@ def GenericInstanceCreate(mode, opts, args): else: raise errors.ProgrammerError("Invalid creation mode %s" % mode) - op = opcodes.OpCreateInstance(instance_name=instance, + op = opcodes.OpInstanceCreate(instance_name=instance, disks=disks, disk_template=opts.disk_template, nics=nics, diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py index 8799a540b..12fa70957 100644 --- a/lib/client/gnt_instance.py +++ b/lib/client/gnt_instance.py @@ -409,7 +409,7 @@ def BatchCreate(opts, args): elif not tmp_nics: tmp_nics = [{}] - op = opcodes.OpCreateInstance(instance_name=name, + op = opcodes.OpInstanceCreate(instance_name=name, disks=disks, disk_template=specs['template'], mode=constants.INSTANCE_CREATE, diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 1d3d9a7a3..d60b4902e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -6775,7 +6775,7 @@ def _CheckOSParams(lu, required, nodenames, osname, osparams): osname, node) -class LUCreateInstance(LogicalUnit): +class LUInstanceCreate(LogicalUnit): """Create an instance. """ diff --git a/lib/opcodes.py b/lib/opcodes.py index 694a88f82..181d2a765 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -744,7 +744,7 @@ class OpNodeEvacuationStrategy(OpCode): # instance opcodes -class OpCreateInstance(OpCode): +class OpInstanceCreate(OpCode): """Create an instance. @ivar instance_name: Instance name diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py index 58da35b63..275ab1e61 100644 --- a/lib/rapi/rlib2.py +++ b/lib/rapi/rlib2.py @@ -707,7 +707,7 @@ class R_2_groups_name_assign_nodes(baserlib.R_Generic): def _ParseInstanceCreateRequestVersion1(data, dry_run): """Parses an instance creation request version 1. - @rtype: L{opcodes.OpCreateInstance} + @rtype: L{opcodes.OpInstanceCreate} @return: Instance creation opcode """ @@ -769,7 +769,7 @@ def _ParseInstanceCreateRequestVersion1(data, dry_run): beparams = baserlib.CheckParameter(data, "beparams", default={}) utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES) - return opcodes.OpCreateInstance( + return opcodes.OpInstanceCreate( mode=baserlib.CheckParameter(data, "mode"), instance_name=baserlib.CheckParameter(data, "name"), os_type=baserlib.CheckParameter(data, "os"), @@ -831,7 +831,7 @@ class R_2_instances(baserlib.R_Generic): Request data version 0 is deprecated and should not be used anymore. - @rtype: L{opcodes.OpCreateInstance} + @rtype: L{opcodes.OpInstanceCreate} @return: Instance creation opcode """ @@ -865,7 +865,7 @@ class R_2_instances(baserlib.R_Generic): nics[0]["bridge"] = fn("bridge") # Do not modify anymore, request data version 0 is deprecated - return opcodes.OpCreateInstance( + return opcodes.OpInstanceCreate( mode=constants.INSTANCE_CREATE, instance_name=fn('name'), disks=disks, diff --git a/test/ganeti.rapi.rlib2_unittest.py b/test/ganeti.rapi.rlib2_unittest.py index 606baf251..f7d51d8ac 100755 --- a/test/ganeti.rapi.rlib2_unittest.py +++ b/test/ganeti.rapi.rlib2_unittest.py @@ -118,7 +118,7 @@ class TestParseInstanceCreateRequestVersion1(testutils.GanetiTestCase): for dry_run in [False, True]: op = self.Parse(data, dry_run) - self.assert_(isinstance(op, opcodes.OpCreateInstance)) + self.assert_(isinstance(op, opcodes.OpInstanceCreate)) self.assertEqual(op.mode, mode) self.assertEqual(op.disk_template, disk_template) self.assertEqual(op.dry_run, dry_run) diff --git a/tools/burnin b/tools/burnin index 3adbe8396..d6ab042e7 100755 --- a/tools/burnin +++ b/tools/burnin @@ -564,7 +564,7 @@ class Burner(object): Log(msg, indent=2) - op = opcodes.OpCreateInstance(instance_name=instance, + op = opcodes.OpInstanceCreate(instance_name=instance, disks = [ {"size": size} for size in self.disk_size], disk_template=self.opts.disk_template, @@ -718,7 +718,7 @@ class Burner(object): rem_op = opcodes.OpRemoveInstance(instance_name=instance, ignore_failures=True) imp_dir = utils.PathJoin(constants.EXPORT_DIR, full_name) - imp_op = opcodes.OpCreateInstance(instance_name=instance, + imp_op = opcodes.OpInstanceCreate(instance_name=instance, disks = [ {"size": size} for size in self.disk_size], disk_template=self.opts.disk_template, -- GitLab