a '¡Dg ã@s\ddlZddlZddlZddlmZmZe e¡ZdddœZ dd„Z d d d „Z dd d „Z dS)éN)ÚhelpersÚutila' This system is using the EC2 Metadata Service, but does not appear to be running on Amazon EC2 or one of cloud-init's known platforms that provide a EC2 Metadata service. In the future, cloud-init may stop reading metadata from the EC2 Metadata Service unless the platform can be identified. If you are seeing this message, please file a bug against cloud-init at https://github.com/canonical/cloud-init/issues Make sure to include the cloud provider your instance is running on. For more information see https://github.com/canonical/cloud-init/issues/2795 After you have filed a bug, you can disable this warning by launching your instance with the cloud-config below, or putting that content into /etc/cloud/cloud.cfg.d/99-ec2-datasource.cfg #cloud-config datasource: Ec2: strict_id: falseaã A new feature in cloud-init identified possible datasources for this system as: {dslist} However, the datasource used was: {source} In the future, cloud-init will only attempt to use datasources that are identified or specifically configured. For more information see https://bugs.launchpad.net/bugs/1669675 If you are seeing this message, please file a bug against cloud-init at https://github.com/canonical/cloud-init/issues Make sure to include the cloud provider your instance is running on. After you have filed a bug, you can disable this warning by launching your instance with the cloud-config below, or putting that content into /etc/cloud/cloud.cfg.d/99-warnings.cfg #cloud-config warnings: dsid_missing_source: off)Z non_ec2_mdZdsid_missing_sourcecCs&tj| di¡ di¡d}| d¡S)NZ system_infoÚpaths)Z path_cfgsÚwarnings)rZPathsÚgetZ get_ipath_cur)Úcfgr©rú6/usr/lib/python3.9/site-packages/cloudinit/warnings.pyÚ _get_warn_dir?sÿr TcCsš||f}|rt|tƒs|St |d|f¡}|dur6|S|dvrBdS|dvrNdS| d¡\}}}|dkrj|S|r’z t|ƒ}Wnty|YS0d|fS) Nr)ZonÚtrueT)TN)ZoffZfalseF)FNú,ÚsleepT)Ú isinstanceÚdictrZget_cfg_by_pathÚ partitionÚintÚ ValueError)rÚnameÚmoder ÚdefaultZncfgÚ_Zcsleeprrr Ú_load_warn_cfgFs&   rcKs|dur i}t||||d\}}|s(dSt|jfi|¤Ž}d}|d}d|}d|d} g} | d¡ ¡D]} |  || ¡qn| } |r¢d|} |  |d¡d} t t j   t |ƒ|¡| d  | ¡d| ¡t  d| d  | ¡| ¡|rt  d ||¡t |¡dS) N)rr éFéz # %%-%ds #Ú*Ú z [sleeping for %d seconds] z%s%s %sz$sleeping %d seconds for warning '%s')rÚWARNINGSÚformatÚstripÚ splitlinesÚappendÚcenterrZ write_fileÚosÚpathÚjoinr ÚLOGZwarningÚdebugÚtimer )rrr rÚkwargsÚmsgZmsgwidthZ linewidthÚfmtZtoplineZfmtlinesÚlineZ closelineZsleepmsgrrr Ú show_warningfs2 þr,)TN)NNT) Zloggingr"r'Z cloudinitrrZ getLoggerÚ__name__r%rr rr,rrrr Ús æ5