def generate_vm_name(options):
 if ('BUILD_NUMBER' in os.environ):
  random_part = 'BUILD{0:0>6}'.format(os.environ.get('BUILD_NUMBER'))
 else:
  random_part = os.urandom(3).encode('hex')
 return '{0}-{1}-{2}'.format(options.vm_prefix, options.platform, random_part)

def generate_vm_name ( options ) : if ( 'BUILD_NUMBER' in os . environ ) : random_part = 'BUILD{0:0>6}' . format ( os . environ . get ( 'BUILD_NUMBER' ) ) else : random_part = os . urandom ( 3 ) . encode ( 'hex' ) return '{0}-{1}-{2}' . format ( options . vm_prefix , options . platform , random_part )
generate a random enough vm name .