!V1fi ddlZddlmZddlmZddlmZmZmZm Z ddl m Z m Z m Z mZmZddlmZej$ej&eZddd d d d Ze j.j0e j.j2e j.j4d ZGddeZdeefdZededdeeeeeffdZ ddeede j@fdZ!y)N)Enum) lru_cache)DictOptionalTupleType)clouds exceptionsmessagessystemutil)apply_config_settings_overrideAWSz AWS ChinazAWS GovAzureGCPawsz aws-chinazaws-govazuregce)rrrceZdZdZdZy)NoCloudTypeReasonrN)__name__ __module__ __qualname__NO_CLOUD_DETECTEDCLOUD_ID_ERROR:/usr/lib/python3/dist-packages/uaclient/clouds/identity.pyrrs Nrrreturnc tjgd\}}|jS#tj$rYnwxYwt j dy)z%Query cloud instance-id from cmdline.)z cloud-initquery instance_idz'Unable to determine current instance-idN)r subpstripr ProcessExecutionErrorLOGwarning)out_errs r get_instance_idr,sN KK FG Tyy{  + +   KK9: s),AA)maxsize cloud_typecJtjdr, tjdg\}}|jdfSdtjfS#tj $r;}t jdt|dtjfcYd}~Sd}~wwxYw)Nzcloud-idzerror running cloud-id: %s) r whichr%r&r r'r(debugstrrrr)r*r+excs r get_cloud_typer4+s||J < ZL1ICIIK& & #55 66 // < II2CH =+::; ; rUs..??:g:::8DE     == - - ]] 1 1 == - - #  4 - 7hsmX6G-HHI 7. 7%)#SM# ###r