Пример #1
0
    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")
Пример #2
0
    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()
Пример #3
0
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)