def GenericGetDiskInfo(self, uuid=None, name=None):
    if uuid:
      disk = self.cfg.GetDiskInfo(uuid)
      if disk is None:
        raise errors.OpPrereqError("No disk was found with this UUID: %s" %
                                   uuid, errors.ECODE_INVAL)
    elif name:
      disk = self.cfg.GetDiskInfoByName(name)
      if disk is None:
        raise errors.OpPrereqError("No disk was found with this name: %s" %
                                   name, errors.ECODE_INVAL)
    else:
      raise errors.ProgrammerError("No disk UUID or name was given")

    return disk
Test C{insecureRandom} without C{random.getrandbits}.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/instance_set_params.py/LUInstanceSetParams.GenericGetDiskInfo--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/test/test_randbytes.py/RandomBaseTests.test_withoutGetrandbits