a 'Dgr @sUdZddlZddlmZddlmZddlmZddlm Z ddl m Z dd ge gd Z ee d <eeZd Zd ZeeeeddddZdS)z,Users and Groups: Configure users and groupsN)Cloud)Config) MetaSchema)ug_util) PER_INSTANCEZcc_users_groupsall)idZdistrosZ frequencyZactivate_by_schema_keysmeta)Zno_create_homesystem)ssh_authorized_keys ssh_import_idssh_redirect_user)namecfgcloudargsreturnc s8t||j\}}t|\}}|p*g}|D]\}} |j|| q4|D]\} fddtD} fddtD} | r| rt d| dd | dd |  dd } | rd vsd vrt d | | d vrt d| | f|durt d| | n|d<|d<|jj| fiqTdS)Ncsg|]}|r|qSget.0keyZconfigrD/usr/lib/python3.9/site-packages/cloudinit/config/cc_users_groups.py -zhandle..csg|]}|r|qSrrrrrrr.rzNot creating user z . Key(s) z, z cannot be provided with r Fr r zdNot creating user %s. ssh_redirect_user cannot be provided with ssh_import_id or ssh_authorized_keys)TdefaultzfNot creating user %s. Invalid value of ssh_redirect_user: %s. Expected values: true, default or false.zzIgnoring ssh_redirect_user: %s for %s. No default_user defined. Perhaps missing cloud configuration users: [default, ..].Zcloud_public_ssh_keys)rZnormalize_users_groupsZdistroZextract_defaultZget_public_ssh_keysitemsZ create_groupNO_HOME NEED_HOME ValueErrorjoinpopLOGZwarningZ create_user)rrrrZusersgroupsZ default_userZ _user_configZ cloud_keysmembersuserZno_homeZ need_homer rrrhandle#sJ    r()__doc__ZloggingZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.settingsrr __annotations__Z getLogger__name__r$rr strlistr(rrrrs