def testRenameToExistingName(self): group = self.cfg.AddNewNodeGroup() op = opcodes.OpGroupRename(group_name=group.name, new_name=self.group.name) self.ExecOpCodeExpectOpPrereqError( op, "Desired new name .* clashes with existing node group")
def testRename(self): group = self.cfg.AddNewNodeGroup() op = opcodes.OpGroupRename(group_name=group.name, new_name="new_group_name") self.ExecOpCode(op) self.mcpu.assertLogIsEmpty()
def RenameGroup(opts, args): """Rename a node group. @param opts: the command line options selected by the user @type args: list @param args: a list of length 2, [old_name, new_name] @rtype: int @return: the desired exit code """ group_name, new_name = args op = opcodes.OpGroupRename(group_name=group_name, new_name=new_name) SubmitOrSend(op, opts)