def read_vmware_imc(config): md = {} cfg = {} ud = None if config.host_name: if config.domain_name: md['local-hostname'] = config.host_name + "." + config.domain_name else: md['local-hostname'] = config.host_name if config.timezone: cfg['timezone'] = config.timezone # Generate a unique instance-id so that re-customization will # happen in cloud-init md['instance-id'] = "iid-vmware-" + util.rand_str(strlen=8) return (md, ud, cfg)
def encrypt_pass(password, salt_id="$6$"): return crypt.crypt(password, salt_id + util.rand_str(strlen=16))
def rand_user_password(pwlen=9): return util.rand_str(pwlen, select_from=PW_SET)