def CheckPrereq(self):
    try:
      new_name_uuid = self.cfg.LookupNodeGroup(self.op.new_name)
    except errors.OpPrereqError:
      pass
    else:
      raise errors.OpPrereqError("Desired new name '%s' clashes with existing"
                                 " node group (UUID: %s)" %
                                 (self.op.new_name, new_name_uuid),
                                 errors.ECODE_EXISTS)
Check prerequisites.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/group.py/LUGroupRename.CheckPrereq