Commit 9a3cc7ae authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename OpSetInstanceParams and LUSetInstanceParams


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 668f755d
......@@ -1280,7 +1280,7 @@ def SetInstanceParams(opts, args):
" specifying a secondary node")
return 1
op = opcodes.OpSetInstanceParams(instance_name=args[0],
op = opcodes.OpInstanceSetParams(instance_name=args[0],
nics=opts.nics,
disks=opts.disks,
disk_template=opts.disk_template,
......
......@@ -6608,7 +6608,7 @@ def _CreateDisks(lu, instance, to_skip=None, target_node=None):
" node %s" % (file_storage_dir, pnode))
# Note: this needs to be kept in sync with adding of disks in
# LUSetInstanceParams
# LUInstanceSetParams
for idx, device in enumerate(instance.disks):
if to_skip and idx in to_skip:
continue
......@@ -8839,7 +8839,7 @@ class LUInstanceQueryData(NoHooksLU):
return result
class LUSetInstanceParams(LogicalUnit):
class LUInstanceSetParams(LogicalUnit):
"""Modifies an instances's parameters.
"""
......
......@@ -982,7 +982,7 @@ class OpInstanceQueryData(OpCode):
]
class OpSetInstanceParams(OpCode):
class OpInstanceSetParams(OpCode):
"""Change the parameters of an instance."""
OP_ID = "OP_INSTANCE_SET_PARAMS"
OP_DSC_FIELD = "instance_name"
......
......@@ -1271,7 +1271,7 @@ class R_2_instances_name_rename(baserlib.R_Generic):
def _ParseModifyInstanceRequest(name, data):
"""Parses a request for modifying an instance.
@rtype: L{opcodes.OpSetInstanceParams}
@rtype: L{opcodes.OpInstanceSetParams}
@return: Instance modify opcode
"""
......@@ -1293,7 +1293,7 @@ def _ParseModifyInstanceRequest(name, data):
utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES,
allowed_values=[constants.VALUE_DEFAULT])
return opcodes.OpSetInstanceParams(instance_name=name, hvparams=hvparams,
return opcodes.OpInstanceSetParams(instance_name=name, hvparams=hvparams,
beparams=beparams, osparams=osparams,
force=force, nics=nics, disks=disks,
disk_template=disk_template,
......
......@@ -327,7 +327,7 @@ class TestParseModifyInstanceRequest(testutils.GanetiTestCase):
}
op = self.Parse(name, data)
self.assert_(isinstance(op, opcodes.OpSetInstanceParams))
self.assert_(isinstance(op, opcodes.OpInstanceSetParams))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.hvparams, hvparams)
self.assertEqual(op.beparams, beparams)
......@@ -344,7 +344,7 @@ class TestParseModifyInstanceRequest(testutils.GanetiTestCase):
name = "instir8aish31"
op = self.Parse(name, {})
self.assert_(isinstance(op, opcodes.OpSetInstanceParams))
self.assert_(isinstance(op, opcodes.OpInstanceSetParams))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.hvparams, {})
self.assertEqual(op.beparams, {})
......
......@@ -863,10 +863,10 @@ class Burner(object):
Log("Adding and removing disks")
for instance in self.instances:
Log("instance %s", instance, indent=1)
op_add = opcodes.OpSetInstanceParams(\
op_add = opcodes.OpInstanceSetParams(\
instance_name=instance,
disks=[(constants.DDM_ADD, {"size": self.disk_size[0]})])
op_rem = opcodes.OpSetInstanceParams(\
op_rem = opcodes.OpInstanceSetParams(\
instance_name=instance, disks=[(constants.DDM_REMOVE, {})])
op_stop = self.StopInstanceOp(instance)
op_start = self.StartInstanceOp(instance)
......@@ -880,9 +880,9 @@ class Burner(object):
Log("Adding and removing NICs")
for instance in self.instances:
Log("instance %s", instance, indent=1)
op_add = opcodes.OpSetInstanceParams(\
op_add = opcodes.OpInstanceSetParams(\
instance_name=instance, nics=[(constants.DDM_ADD, {})])
op_rem = opcodes.OpSetInstanceParams(\
op_rem = opcodes.OpInstanceSetParams(\
instance_name=instance, nics=[(constants.DDM_REMOVE, {})])
Log("adding a NIC", indent=2)
Log("removing last NIC", indent=2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment