x[hzddlZddlZddlZddlZddlZddlZddlZddlmZm Z m Z m Z ddl m Z mZddl mZddl mZddl mZddl mZddl mZdd l mZdd l mZdd l mZdd l mZdd l mZddl mZddl mZddl mZddlmZmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/e0Z1dZ2dZ3e,e-e.dZ4ddddd Z5ejle7Z8dAd!Z9dBd"Z:d#Z;ejxd$e8jzfd%e e0gdffd&Z>d'Z?d(e$fd)Z@d*ZAdCd+ZBdDd,e eCe0ffd-ZDd.ZEd/ZFd0ee e0eGfd,e eHe1ffd1ZId2eejd,e eHe1ffd3ZKd4ZLd5ZMd6ZNd7ZOd8ZPd9ejfd:ZRd;ZSd<ZTdBd=ZUd>ZVd?ZWe7d@k(r#ejeUejyy)EN)OptionalTupleCallableUnion)featuresnetinfo)signal_handler)sources)socket)stages) url_helper)util) performance)version)warnings) reporting) atomic_helper) lifecycle)handlers)log_utilloggers)read_cfg_paths)cc_set_hostname)Modules)validate_cloudconfig_schema)log_with_downgradable_level)events) PER_INSTANCE PER_ALWAYSPER_ONCE CLOUD_CONFIGzOCloud-init v. {version} running '{action}' at {timestamp}. Up {uptime} seconds.zcloud_%s_modules)instancealwaysoncez Local Stagez Network Stagez Config Stagez Final Stage) init-localinitmodules-config modules-finalc|r"tjjd|ztjjdtjjdtjtjtjjdtjjdy)N%s z<------------------------------------------------------------ )file)sysstderrwrite traceback print_excmsgs 4/usr/lib/python3/dist-packages/cloudinit/cmd/main.pyr1r1Tsu  3(JJXJJT SZZ(JJXJJTc`|s t|}tjd|zddt|S)Nr*FT)consoler.log)welcome_formatr multi_logLOG)actionr3s r4welcomer=^s, V$ v~uTsK Jr5ctjtjt j t j |S)N)ruptime timestampr<)WELCOME_MSG_TPLformatrversion_stringrr? time_rfc2822r<s r4r9r9es>  ! !&&({{}##% " r5 Closing stdinloggercdtjtjj sk|dt tj 5}tj|j tjj dddy|dy#1swYyxYw)zj reopen stdin as /dev/null to ensure no side effects logger: a function for logging messages rFNz"Not closing stdin, stdin is a tty.)osisattyr-stdinfilenoopendevnulldup2)rGfps r4 close_stdinrQnsy 99SYY%%' ( "**  5 GGBIIK!1!1!3 4 5 5 34 5 5s AB&&B/cg}|jrI|jD]:}|jtjj |j <|SN)filesappendrIpathrealpathname)argsfn_cfgsfhs r4 extract_fnsr\}sKG zz** 6B NN277++BGG4 5 6 Nr5modscNt|z}|j|\}}t|t|z}|dk(rBd|d|d}tjj d|zt j|gSt jdt|t||S)NrzNo 'z ' modules to run under section ''r*zRan %s modules with %s failures)MOD_SECTION_TPL run_sectionlenr-r.r/r;debug)r] action_namesectionfull_section_name which_ranfailurestotal_attemptedr3s r4run_module_sectionrjs'73 ,,->?Y)ns8}4O!    3( #  -s9~s8} r5cp|jdr%tj|jdyy)Nr)getrupdate_configuration)cfgs r4apply_reporting_cfgros* ww{&&sww{';<r5cxtj|}|D]}||vs|||fcStd|d|d)Nz No keys (z) found in string 'r_)rkeyval_str_to_dictKeyError)cmdlinenamesdatakeys r4parse_cmdline_urlrwsH  " "7 +D" $;S > !" '5I JJr5returnc|tj} t|\}}|j d}|rmtjj|rN|r/d|d|d}tj}|rtj }||fSd|d|d}tj}||fS|dd d d }|s|rtj}d |d <ntj }d|d <d} d} tjd%i|} d} | jrd } t| tj r< | t#| j%t'| z } | j | s d} n| j*j | sd} | r|dk(rgt-j.dddd S|dk(rtj}ntj}|d|dt1| fS|d|d| j2dfS| | j*z} tj6|| d !tjd"|d#|d$|fS#t$rtj dfcYSwxYw#t($rYwxYw#tj4$r}|d|d|fcYd}~Sd}~wwxYw)&aWrite data from url referenced in command line to path. path: a file to write content to if downloaded. network: should network access be assumed. cmdline: the cmdline to parse for cloud-config-url. This is used in MAAS datasource, in "ephemeral" (read-only root) environment where the instance netboots to iscsi ro root. and the entity that controls the pxe config has to configure the maas datasource. An attempt is made on network urls even in local datasource for case of network set up in initramfs. Return value is a tuple of a logger function (logging.DEBUG) and a message indicating what happened. Nz!No kernel command line url found.)zfile:///zfile 'zC' existed, possibly from local stage download of command line url 'z'. Not re-writing.zE' existed, possibly from previous boot download of command line url ' T)urltimeoutretriesstream sec_betweeng?s #cloud-configr5) chunk_sizeFr}z!The kernel command line key `url`z22.3zD Please use `cloud-config-url` kernel command line parameter instead deprecateddeprecated_version extra_messageskip_logcloud-config-urlz contents of 'z' did not start with zurl 'z' returned code z . Ignoring.zretrieving url 'z ' failed: i)modezwrote cloud-config data from z='z' to )r get_cmdlinerwrrloggingDEBUG startswithrIrVexistsINFOWARNr read_file_or_urlok isinstance UrlResponsenext iter_contentrb StopIterationcontentsr deprecatestrcodeUrlError write_file)rVnetworkrs cmdline_namer} path_is_localmlevelkwargsruheaderrespsniffed_content is_cloud_cfges r4attempt_cmdline_urlrs&""$D-g6 cNN#34M- AEcK LLE qz AEcK LLEqzRA FF-  !}  #} D F*D**4V4 779L$ 6 67#t))S[)A(O '11&9#(L]]--f5$ 5($..#F+1'@!%  #55#LLE#LLE#C5(=c&k]K :=tyyI .  OOD$U+ d $ ] D BCCDV%>   D3BCCDsgH-!AI%'I AI8II+I-I  I  IIIIJ1 J:JJcdtjjtjjfz}tj j |jjdd}tj j|rXtj|}||k7r=tjd|jdtj||yytj j|jj!drtj#dtj||y) zPurge the cache if python version changed on us. There could be changes not represented in our cache (obj.pkl) after we upgrade to a new version of python, so at that point clear the cache z%d.%druzpython-versionz-Python version change detected. Purging cacheTobj_pklzMWriting python-version file. Cache compatibility status is currently unknown.N)r- version_infomajorminorrIrVjoinpaths get_cpathrrload_text_filer;rc purge_cacher get_ipath_curinfo)r&current_python_versionpython_version_pathcached_python_versions r4$purge_cache_on_python_version_changers %  ('',, V$&6 ww~~)* $ 3 34G H !$: : IIE F   T " OO/1G H ; 77>>$**229= > HHC  +-CDr5c^tj|jdry|j S)Ndisable_network_activationF)rget_cfg_option_boolrnlocal)r&rYs r4_should_bring_up_interfacesr5s& *FGzz>r5 raw_configc@|sytj|jdddk7ry tj|}t|tsy d |vrG|d D]?}|jd xsi}|jd d}|s-|jdr?y|jdry|jdijdry|jdryy#t $r-}t tdtjd|fYd}~y d}~wwxYw)aDetermine if our cloud-config requires us to wait User data requires us to wait during cloud-init network phase if: - We have user data that is anything other than cloud-config - This can likely be further optimized in the future to include other user data types - cloud-config contains: - bootcmd - random_seed command - mounts - write_files with source )Fzno configuration foundN*ztext/cloud-config)Tz non-cloud-config user data foundz24.4z'Unexpected failure parsing userdata: %s)rGrrequested_levelr3rY)Tz!failed to parse user data as yaml)Tz(parsed config not in cloud-config format write_filessourceuri)rzzfile:)Tz!write_files with source uri foundbootcmd)Tz bootcmd found random_seedcommand)Tzrandom_seed command foundmounts)Tz mounts found)Fz8cloud-config does not contain network requiring elements)rtype_from_starts_withstripyaml safe_load Exceptionrr;rWARNINGrdictrlr)r parsed_yamlritem source_dict source_uris r4_should_wait_via_user_datar;s" . &&z'7'7'9#2'>?  8 9nnZ0  k4 (? # . AD((8,2K$3J:#8#8#H@  A y!$}b)--i80x # L5 9##OO9  99sC'' D0#DD datasourcec|syt|j\}}|rd|dfSt|j\}}|rd|dfSt|j\}}|rd|dfSdd|d|d |fS) zDetermine if we should wait on network connectivity for cloud-init. We need to wait during the cloud-init network phase if: - We have no datasource - We have user data that may require network access )Tzno datasource foundTz in user dataz in vendor dataz in vendor data2Fz user data: z, vendor data: z, vendor data2: )rget_userdata_rawget_vendordata_rawget_vendordata2_raw)ruser_should_wait user_reasonvendor_should_wait vendor_reasonvendor2_should_waitvendor2_reasons r4_should_wait_on_networkrvs *$>##%%!k }M222(B%%')%  o666*D&&(+'''7888 +')?++, . r5ctjtjg}|jrtjg}t t j jdtzd|j g|jrdnd}t|}tj||j}|jt|d}d} |js2t!fdt#j$|j&|\}}n#t#j(|j&|\}}|j8r)t.j9d t;j<|js4t;j>|j&tA|j&tC|| t.jEd t jF|D]\} }t.jI| | |jK|jL} tO||jrtjPntjR} | tjRk(rtTjVrgt j jY|jLj[d s/t.j9d|j\j_d} t`jbjedtgjhznd} t#jj|j&dd} | rt.j9dd} nH| jmd}t j jY|rt.j9d|d} |jotq||} |js| | tjRk(r>|jtjv| k7r%t.j9d| |jtdgfSt||j}t.j9d| |||j| tjPk(rt|d d!"|j}|| tjPk(rtTjVrvt|jt\}}|rt.j9d#|nEt.j9d$|t#j|jLj[d d%|jtjv| k7r/t.j9d&| |jt|jtgfSt.j9d'| |jt|j|jt|d(d)" |jjd*|jtgt+\}}|s|jt|jLjmd-}t j jY|rXt j|jd.k7r6ttjt#j|ddd/0nt.j9d1tA|j&t|t||j2} |}|}t#j(|j&|\}}||k7s||k7r:t.jd3||t#j$|j&|\}}t;j>|j&|jt|jt|j&5|jtt|||fS#t*$rLd}t#j,t.|t1|j3t4j6|fYwxYw#t*$rt#j,t.d Y/wxYw#tjx$r| tjPk(rt.j9dnt#j,t.d|jzsH|j}|t.j9d| | tjPk(rdgfcYSddgfcYSt.j9d| YwxYw#t*$r,t#j,t.d,|jtd,gfcYSwxYw#t*$rt#j,t.d4YwxYw)6Nz%s.dz91_kernel_cmdline_url.cfg)rVrr%r&ds_depsreportercFjtj|fSrS)rUrr)r3 early_logss r4zmain_init..sJ$5$5w}}c6J$Kr5#Failed to setup output redirection!@Logging being reset, this logger may no longer be active shortlyr2!PID [%s] started cloud-init '%s'.z0Failed to initialize, likely bad things to come!z .skip-networkz4Will wait for network connectivity before continuingtrustr*checkmanual_cache_cleanFz"manual cache clean set from configmanual_clean_markerz(manual cache clean found from marker: %sexistingz)[%s] Exiting. datasource %s in local modezNo local datasource foundz8No instance datasource found! Likely bad things to come!)bring_upz[%s] Exiting without datasourcezNo instance datasource found.z2[%s] barreling on in force mode without datasourcez5[%s] %s will now be targeting instance id: %s. new=%srr)stage retry_stagezTNetwork connectivity determined necessary for cloud-init's network stage. Reason: %szVNetwork connectivity determined unnecessary for cloud-init's network stage. Reason: %srz.[%s] Exiting. datasource %s not in local mode.z6[%s] %s is in local mode, will apply init modules now.zinit-netzmodules:config consume_data)rYfreqzConsuming user data failed! cloud_configrT)configstrict log_detailslog_deprecationsz2Skipping user-data validation. No user-data found.rz#Stdout, stderr changing to (%s, %s)z'Failed to re-adjust output redirection!)rrn)Wr DEP_FILESYSTEM DEP_NETWORKrrrIrVrr!r9r Initrread_cfgr\skip_log_setuprQr fixup_outputrnget_output_cfgrlogexcr;r1rUrrrcr reset_logging setup_loggingror=rgetppidr8 initializerr DSMODE_LOCALDSMODE_NETWORKrMANUAL_NETWORK_WAITr get_runpathdistrowait_for_networkr-r.r/r debug_inforrrrfetchrdsmodeDataSourceNotFoundExceptionforceapply_network_config_maybe_persist_instance_data instancifyis_new_instance_maybe_set_hostnamerrsetup_datasourceupdatecloudifyrunrrrstatst_sizerrrrrwarningactivate_datasourcedi_report_warnrj)rXrYdepsbootstage_namew_msgr&outfmterrfmtr3lvl path_helperrrmcfgmfilebring_up_interfacesiid should_waitreasonran_resultscloud_cfg_pathr] outfmt_orig errfmt_origrs @r4 main_initr7sw  " "G$7$7 8D zz&&' %'B N  J,&*ZZ\VN > *E ;;tdmm NFF!004@NFF  zz N     dhh'DHH%  DeHH 0"**,OS SM **K(.#'::7  73I3ID w%%%  ' ' JJ " "? 31  IIL M KK ( ( * 7#5#5#789''2FN  II: ;H--.CDEww~~e$ DeL" 6dDA H % 7)) )doo.D.D.L II;  ": .!& // CII?      w### DYG':; w###  ' '"9$//"J K =  =  6 6 GL ?? ! !T ) II@  OOR( ( IIH  KKMJ>$"5"5n"EF!   FG! 4T*T]] CDD  ..txx> & K6$9 KK=vv N#004@ VV $((# doo488< OO/dDA BBY /3 C#7<<-. /8 M CKLMT  . . 7'' ' II1 2 KKO zz  % %/B % C II7 >w+++bz!>?@@ IIDd %@ B C67"?!@AAB8 D CBCDslA!_`;A"aAd2A+eA``#aaB!d +d 2d  d 2ee#e.-e.cd|vrtjdy|d}|tjdyt|tstj d|y|j d}|tj dyt|t stj d|y|jjdd }|jtjr|ttjd}ntj d ||||vrtjd |||ytjd ||t| y)N di_reportzno di_report found in config.zdi_report was None.z%di_report config not a dictionary: %sdatasource_listz(no 'datasource_list' found in di_report.z(di_report/datasource_list not a list: %s.r|z1Datasource '%s' came from unexpected module '%s'.z:used datasource '%s' from '%s' was in di_report's list: %sdsid_missing_source)rdslist)r;rcrrr"rllist __module__ rpartitionrr DS_PREFIXrbr show_warningr)rrndicfgr=modnames r4r$r$s7# 12  E } '( eT " ;UC YY( )F ~ >?  % >G##..s3A6G'++,#g//023 ?   & H      s73v;r5cH|j}|d|}t|}tjg|j}|j t | |jdt|t!|t ||j} |j"s*t%tj&|j(||j,r)tj-dt/j0|j"s4t/j2|j(t5|j(t7|| tj9d t;j<||d k(rt?j@d d dtC|||S#tj$r?d|z}tjt|t||js|gcYSYwxYw#t*$rtjtdYPwxYw)N:rrrzGCan not apply stage %s, no datasource found! Likely bad things to come!rrrr2rr&z `--mode init`24.1Use `cloud-init init` instead.)rrr)"rr9r rrrr\rr rrrr;r1rrrrrQrrnrrcrrr ror=rrIr rrrj)rdrYrXr&r'r&r3r]s r4 main_modulesrIs 99D!,T2N > *E ;;rDMM :DMM+d#$  G $!& 4T*T]] CD@"" M   dhh - zz N     dhh'DHH% DeHH 0"**,O v~&%:  dD$ //U  . .   $ %  C#zz7N $ @ C>?@s%F%6G:%A G76G7:#H! H!c|j}t|}tjg|j}|j t | |jdt|t!|t ||j}|j"}|rtj%d||j&}|r+tj%d|t(j+|} t-tj.|j0d|j$r)tj%d t5j6t5j8|j0t;|j0t=|| |j?|||\}} | rtjAd |y|stjAd |yy#tj$r7tjtdtd|jsYyYwxYw#t2$rtjtd Y2wxYw)Nrrrz;Failed to fetch your datasource, likely bad things to come!rrzUsing passed in arguments %szUsing passed in frequency %srrr2zRan %s but it failed!zDid not run %s, does it exist?r)!rXr9r rrrr\rr rrrr;r1rrr module_argsrc frequencyFREQ_SHORT_NAMESrlrQrrnrrrr ror= run_singler") rXrYmod_namer'r&r]mod_argsmod_freqrgrhs r4 main_singlerRsyyH 4 E ;;rDMM :DMM+d#$  G $!& 4T*T]] CDH 0(;~~H 0(;#''1@  $((D) zz N   $((#! De!OOHhIY +X6  4h?e  . .  N   I zz 4 @ C>?@s%G0*H&AH#"H#&#I  I c  t}|jd}tjj |j }tjj |d}tjj |d}tjj |d}tjj |d}tj} tj||f|j\} } |dk(r|jrd} n&d} n#|dk(rd|jz} ntd|z| tvrtd j!| giddd } d d| j#| j#| j#| j#d i}| dk(r!||||fD]}tj$|n) t'j(tj*|}| |d vr| j#|d | <|d }| |d <|| dr%|| dst.j1dt| t3tj4|| d<t7t9d| j:}|j=}t?j@||tjBtjjE|||d | ||}| dvr|\}}|tG||d<n|}|| djI|Dcgc] }tG|c}t3tj4|| d<d|d <|j=}|jU|jWD];}||vr'tYt[||||z|| d|<.|||| d|<=t?j@||| dk(rg}|jWD]O}t]||t^s||jads,|jI||jadgQt?j@|d |d|ditjBtjjE|||dtc|| dS#t,$rYwxYwcc}w#t,$rO}t.jKd| tMd| z|| djOtG|Yd}~d}~wtP$ri}|jRrRt.jKd| tMd| z|| djOdtG|jRdYd}~Rd}~wwxYw#t3tj4|| d<d|d <|j=}|jU|jWD];}||vr'tYt[||||z|| d|<.|||| d|<=t?j@||wxYw)Nruz status.jsonz result.jsonr&r%modules modules-%szunknown name: %sz'Invalid cloud init mode specified '{0}')errorsrecoverable_errorsstartfinishedv1)rr&r%r'r(rrXrYz=Unexpected start time found for %s. Was this stage restarted?c6t|tjSrS)rr LogExporter)hs r4rz status_wrapper..sjG$7$78r5T)r)r&r%rrVzfailed stage %szfailed run of stage %sz sys.exit(z) calledrWr()rrV)2rrrIrVnormpathrun_dirrr getLoggerr ensure_dirsr<rr ValueError STAGE_NAMErBcopydel_filejsonloadsrrr;r"floatr?rfilterr export_logsr write_jsonsym_linkrelpathrextend exceptionr1rU SystemExitr clean_logskeysr>setrrrlrb)rXrYrdata_dlink_d status_path status_link result_path result_link root_logger_namefunctorr nullstatusstatusfrZhandlerpreexisting_recoverable_errorsretrrVrnew_recoverable_errorsrvrs r4status_wrapperrLs  E __V $F WW  emm ,F'',,v}5K'',,v}5K'',,v}5K'',,v}5K##%K   {{UG v~ ::DD  dii'+d233 : 5 <  beii"56 7    "\"2fE F  GGOOK 0+T  r$x! ""A   N#; * '.*T12 4!!#a&))  I 66 MM+T 2 .5 6 tHX  % % #aff+h&G H I %T[[]347 ")!4!4!6)..0 C446:6s;05674-.s37M74-.s3    f5sc (R4':S !S3S 4 SSS VATV V(AV V VVB.Yr&c|jre|jrX|jjd}tj j |s|jjdyyyy)zCWrite instance-data.json file if absent and datasource is restored. instance_dataF) write_cacheN)r ds_restoredrrrIrVrpersist_instance_data)r&instance_data_files r4rrsX 4++!ZZ33ODww~~01 OO 1 1e 1 D2,r5c >|j}tj|j|d\}}}|r$ t j d|j|dyy#tj $r+}tjd||t|Yd}~yd}~wwxYw)zCall set_hostname if metadata, vendordata or userdata provides it. @param stage: String representing current stage in which we are running. @param retry_stage: String represented logs upon error setting hostname. T) metadata_only set_hostnameNzGFailed setting hostname in %s stage. Will retry in %s stage. Error: %s.) rrget_hostname_fqdnrnrhandleSetHostnameErrorr;rcr)r&rrcloudhostname_fqdn_rs r4rrs MMOE11 %tXua   " ">488UD I//  II1A    s"AB1!BBctjjdjt t j dzy)Nr+)r-stdoutr/rsortedrFEATURES)rXrYs r4 main_featuresrs-JJTYYvg&6&6784?@r5c h tj|stj}t j |j d}|jddddtjzd|jd d d d d |jdd ddd |jddd dd |jd|jdd}|jdd}|jddd d d |jd!d"d#d$d%t jd&'|jdtf(|jd)d*}tj d+d,d-d./j"}|jd0d1d2d3|d4d56|jd!d"d#d$d%t jd&'|jd)t$f(|jd7d8}|jd9d:d2d;d.<|jd=d2d>d t't(j+?|jd@d dAd <|jdBdCdDdEF|jd!d"d#d$d%t jd&'|jd7t,f(|jdGdH}|jdIdJ}|jdIt.f(|jdKdL} |jdMdN} |jdOdP} |jdQdR} |jdSdT} |jdUdV}|rt1dW|Dd}|dKk(rddXlm}|| n|dMk(rddXlm}|| n|dOk(r&ddYlm}m}|| Z| jdO|f(n|dQk(r%dd[lm}m}|| | jdQ|f(n|dGk(r%dd\l m}m!}|||jd]|f(ne|dUk(r%dd^l"m}m#}|||jdU|f(n;|dSk(r6dd_l$m}m%}|| | jdS|f(n|jMd`|jO|a}tQ|dbd |jRs tU|StS|S)cNr)progz --versionz-vrz %(prog)s z'Show program's version number and exit.)r<rhelpz--debugz-d store_truez:Show additional pre-action logging (default: %(default)s).F)r<rdefaultz--forcezDForce running even if no datasource is found (use at your own risk).r)r<rdestrz --all-stages all_stageszsRun cloud-init's stages under a single process using a syncronization protocol. This is not intended for CLI usage.)rr<rrr Subcommands subcommand)titlerr&z2Initialize cloud-init and perform initial modules.)r--localz-lz+Start in local mode (default: %(default)s).z--filez-frUrTz(Use additional yaml configuration files.rb)r<rrtyperErTz1Activate modules using a given configuration key.z`init`rGrHTrz--modez-mstorez9Module configuration name to use (default: %(default)s). r)r&rfinal)r<rrchoicessinglezRun a single module.z--namez-nzModule name to run.)r<rrequiredz --frequencyzModule frequency for this run.)r<rrrz--reportzEnable reporting.rK*argumentz0Any additional arguments to pass to this module.)nargsmetavarrqueryz;Query standardized instance metadata from the command line.rzList defined features.analyzez-Devel tool: Analyze cloud-init logs and data.develzRun development tools.z collect-logsz*Collect and tar all cloud-init debug info.cleanz3Remove logs and artifacts so cloud-init can re-run.r~z/Report cloud-init status or wait on completion.schemaz-Validate cloud-config files using jsonschema.c3DK|]}|jdr|yw)-N)r).0posargs r4 zmain..s J63D3DS3IV Js  ) get_parser)rhandle_collect_logs_args)parser)rhandle_clean_args)r handle_argsrender)rhandle_schema_args)rhandle_status_argsza subcommand is requiredrYr)+rconfigure_root_loggerr-argvargparseArgumentParserpop add_argumentrrC set_defaultsadd_subparsers add_parserFileTyper7rrmessagerIr>rMrrrRrrcloudinit.analyzercloudinit.cmd.devel.parsercloudinit.cmd.devel.logsrcloudinit.cmd.cleanrcloudinit.cmd.queryrcloudinit.config.schemarcloudinit.cmd.statusrerror parse_argssetattrrsub_main) sysv_argsr subparsers parser_init parser_mod extra_help parser_single parser_queryparser_featuresparser_analyze parser_develparser_collect_logs parser_clean parser_status parser_schemaranalyze_parser devel_parser logs_parserr clean_parserr query_parserhandle_query_args schema_parserr status_parserrrYs r4mainr s !!# HH  $ $)--*: ;F  w5578 6    I   -    K  &&&]&NJ''I(K  :    7   t $ VY$78&&K'J$$!6  g   | +    7   t $ I|#<=))-*M  "  -%**,-     ?     7   t $ x&=>(( J)L !++1,O  ](C D**G+N((.)L%//I0((K)L))H*M))F*M J) J    " F > * 7 " M  & > )  2 3  , ,&(@A - 7 "   &  % %g7H-I % J 7 "   &  % %h8I-J % K 8 #  - (  & &x9K.L & M 8 #  - (  & &x9K.L & M /0   )  ,D D"E* ??~ f r5ctjdtjdddd}tjd|d5|j ddg }d |_t||_d d d |d5|j dg }d |_t||_d d d |d5|j d dg }d |_t||_d d d |d5|j d dg }d |_t||_d d d |jrLd}|jrd|j}tjd|dtjdytjdtjdy #1swY@xYw#1swYxYw#1swYxYw#1swYxYw)z>Run all stages in a single process using an ordering protocol.z*Running cloud-init in single process mode.rrrrzREADY=1r&rrFNTrTz --mode=configz --mode=finalz%a stage of cloud-init exited non-zerozfirst exception received: zSTATUS=Completed with failure, z2. Run 'cloud-init status --long' for more details.z STOPPING=1rzSTATUS=Completed) r;rr SocketSync sd_notifyrrrsystemd_exit_codeexperienced_any_errorfirst_exception)rsyncrYrs r4rrsHH 9:   Wi7 CD Y g0  vy&9 :#!)$ 0 i0  vh /"!)$ 0 h0  y/&B C"!)$ 0 g0  y.&A B"!)$ 0 !!9   243G3G2HIG-gY7) )  &+,&[00000000s0 ,F5+G,G>,G5F?G GG$c|j\}}|dvr@tj|jrtj ntj n |jrtjtjd|k(sd|k(rd|jk7rt}d}d}|dk(r|jrd\}}ncd\}}n]|dk(rd|jzd|jz}}n9|d k(r+d |jzd |jz}}|j}n |}d |z}d }tj||||_|j 5t#j$d|d5|||}ddddddt'j(d|k(rd|jk(r t+}S#1swYFxYw#1swYJxYw)N)r&rTr&rTT)r%zsearching for local datasources)z init-networkz!searching for network datasourcesrUzrunning modules for %srz single/%szrunning single module %szrunning 'cloud-init %s'F)reporting_enabledzcloud-init stage: 'r_)r<rsetup_basic_loggingrcrrrr attach_handlersrrrrXreportrReportEventStackrrTimedr flush_eventsrb)rYrXr|rname report_onrdescretvals r4rr7skkOT7 &&##!ZZGMMW__  ##%""$ ~)t+$))0C  EI v~ ::LLE5LE5   499 $ $tyy 0   $)) # & 2KK )D0 ++ u DM )   !4UG1= > )T4(F ))DVtyy0V M ) )))s$G( F72G7G <GG __main__)rrS))rr})TN)ZrrfrIr-r0rrtypingrrrr cloudinitrrr r r r r rrrrrrrr cloudinit.logrrcloudinit.cmd.develrcloudinit.configrcloudinit.config.modulesrrrcloudinit.lifecyclercloudinit.reportingrcloudinit.settingsrrr r!rReasonrAr`rMrcr`__name__r;r1r=r9timedrcrQr\rjrorwintrrrbytesboolr DataSourcerr7r$rIrRrrrrrrrrexitrrr5r4rs  33'$ !#+.,,?;& ( %   $"  g! ?#03 5#- 5$ 5 W&= KjU38_jZE< 8MsEz*+8M 4<8Mv"++," 4<"JuCp/d>0BCLX#vEv{{E.Aod8'vBJ z CHHT#((^r5