o m[h @stddlZddlZddlZddlmZddlmZddlmZm Z ddl m Z ddl m Z eeZGdddZdS) N)Optional)Distro)PathsRunners)events) DataSourcec@seZdZ d&dedededededee j f dd Z e d d Z d'd dZddZd(ddZddZe ddZddZddZd)ddZddZd&d d!Zd&d"d#Zd&d$d%ZdS)*CloudN datasourcepathscfgdistrorunnersreportercCs@||_||_||_||_||_|durtjdddd}||_dS)Nzunnamed-cloud-reporterF)name descriptionreporting_enabled)r r r _cfg_runnersrReportEventStackr)selfr r r r r rr1/usr/lib/python3/dist-packages/cloudinit/cloud.py__init__ s  zCloud.__init__cCs t|jSN)copydeepcopyrrrrrr 6s z Cloud.cfgFcCs|j|||||Sr)rrun)rrfunctorargsfreq clear_on_failrrrr;sz Cloud.runcCs6|jj|}tj|stdtj||dS|S)Nz-No template found in %s for template named %s)r template_tplospathisfileLOGwarningdirname)rrfnrrrget_template_filename>s   zCloud.get_template_filenameTcC |j|Sr)r get_userdata)r apply_filterrrrr,J zCloud.get_userdatacC |jSr)r get_instance_idrrrrr0M zCloud.get_instance_idcCs|jjSr)r launch_indexrrrrr2PszCloud.launch_indexcCr/r)r get_public_ssh_keysrrrrr3Tr1zCloud.get_public_ssh_keyscCr/r)r get_localerrrrr4Wr1zCloud.get_localecCs|jj||dS)N)fqdn metadata_only)r get_hostname)rr5r6rrrr7ZszCloud.get_hostnamecCr+r)r device_name_to_devicerrrrrr8_r.zCloud.device_name_to_devicecCr+r)r get_ipath_curr9rrrr:br.zCloud.get_ipath_curcCr+r)r get_cpathr9rrrr;er.zCloud.get_cpathcCr+r)r get_ipathr9rrrr<hr.zCloud.get_ipathr)NF)T)FF)__name__ __module__ __qualname__rrdictrrrrrrpropertyr rr*r,r0r2r3r4r7r8r:r;r<rrrrrs<        r)rloggingr#typingrcloudinit.distrosrcloudinit.helpersrrcloudinit.reportingrcloudinit.sourcesr getLoggerr=r&rrrrrs