()
Return our UUID.

  Returns:
    a string UUID
  Raises:
    ExperimentsError: machine UUID is malformed
Return our UUID.
Return our UUID .
def FetchUUID():
  """Return our UUID.

  Returns:
    a string UUID
  Raises:
    ExperimentsError: machine UUID is malformed
  """
  uuid_regex = r'^[A-F0-9]{8}-([A-F0-9]{4}-){3}[A-F0-9]{12}$'
  uuid = gmacpyutil.MachineInfoForKey('MachineUUID')
  if not uuid:
    logging.info('No MachineUUID found, trying platform UUID')
    sp = systemconfig.SystemProfiler()
    uuid = sp.GetHWUUID()
  if isinstance(uuid, basestring) and re.match(uuid_regex, uuid):
    return uuid
  else:
    raise ExperimentsError('Malformed UUID: %s' % uuid)
def FetchUUID ( ) : uuid_regex = r'^[A-F0-9]{8}-([A-F0-9]{4}-){3}[A-F0-9]{12}$' uuid = gmacpyutil . MachineInfoForKey ( 'MachineUUID' ) if not uuid : logging . info ( 'No MachineUUID found, trying platform UUID' ) sp = systemconfig . SystemProfiler ( ) uuid = sp . GetHWUUID ( ) if isinstance ( uuid , basestring ) and re . match ( uuid_regex , uuid ) : return uuid else : raise ExperimentsError ( 'Malformed UUID: %s' % uuid )