
    ܍~c                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
mZ  e	j                     d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZmZmZm Z  d dlm!Z! d dl"m#Z# d dlm$Z$ d dl%m&Z& dZ'dZ(eeedZ) ej*                    Z+d5dZ,d6dZ-d Z.d Z/defdZ0d  Z1d7d"Z2d8d$ee3e4f         fd%Z5d& Z6d' Z7d( Z8d) Z9d* Z:d+ Z;d9d,Z<d-ej=        fd.Z>d/ Z?d0 Z@d6d1ZAeBd2k    r7d3ejC        vr
d4ejC        d3<    eAejD                  ZEeEr ejF        eE           dS dS dS ):    N)Tuple)patcher)Modules)validate_cloudconfig_schema)log)netinfo)signal_handler)sources)stages)
url_helper)util)version)warnings)	reporting)events)PER_INSTANCE
PER_ALWAYSPER_ONCECLOUD_CONFIG)atomic_helper)cc_set_hostname)dhclient_hook)read_cfg_pathszOCloud-init v. {version} running '{action}' at {timestamp}. Up {uptime} seconds.zcloud_%s_modules)instancealwaysonce c                    | r"t           j                            d| z             t           j                            d           t           j                            d           t          j        t           j                   t           j                            d           t           j                            d           d S )N%s
z<------------------------------------------------------------
)file)sysstderrwrite	traceback	print_excmsgs    4/usr/lib/python3/dist-packages/cloudinit/cmd/main.pyr&   r&   L   s    
 )
3(((JXJTSZ((((JXJT    c                 h    |st          |           }t          j        d|z  ddt                     |S )Nr   FT)consoler#   r   )welcome_formatr   	multi_logLOG)actionr(   s     r)   welcomer1   V   s9     %V$$N6S>53GGGGJr*   c                     t                               t          j                    t	          j                    t	          j                    |           S )N)r   uptime	timestampr0   )WELCOME_MSG_TPLformatr   version_stringr   r3   time_rfc2822r0   s    r)   r-   r-   ]   sC    !!&(({}}#%%	 "   r*   c                     g }| j         rA| j         D ]9}|                    t          j                            |j                             :|S N)filesappendospathrealpathname)argsfn_cfgsfhs      r)   extract_fnsrE   f   sR     Gz 6* 	6 	6B NN27++BG445555Nr*   modsc                    t           |z  }|                     |          \  }}t          |          t          |          z   }|dk    rGd|d|d}t          j                            d|z             t                              |           g S t                              dt          |          t          |                     |S )Nr   zNo 'z ' modules to run under section ''r   zRan %s modules with %s failures)MOD_SECTION_TPLrun_sectionlenr"   r#   r$   r/   debug)rF   action_namesectionfull_section_name	which_ranfailurestotal_attemptedr(   s           r)   run_module_sectionrS   s   s    '73 ,,->??Y)nns8}}4O!KK
 	
3(((		#			-s9~~s8}}	
 	
 	
 r*   c                     |                      d          r)t          j        |                      d                     d S d S )Nr   )getr   update_configuration)cfgs    r)   apply_reporting_cfgrX      sC    
ww{ =&sww{';';<<<<<= =r*   cloud-config-urlurlc                     t          j        |           }|D ]}||v r|||         fc S t          d| d|d          )Nz	No keys (z) found in string 'rH   )r   keyval_str_to_dictKeyError)cmdlinenamesdatakeys       r)   parse_cmdline_urlrc      s`    "7++D " "$;;S	>!!! 
('''555I
J
JJr*   Treturnc                    |t          j                    }	 t          |          \  }}n# t          $ r t          j        dfcY S w xY w|                    d          p|                    d          }|r^t          j        	                    |           r?|r$d| d|d}t          j
        }|rt          j        }nd| d|d}t          j        }||fS |d	d
dd}|s|rt          j        }d|d<   nt          j        }d|d<   d}	d}
	 t          j        d#i |}d}|                                rd}t          |t          j                  r]	 |t#          |                    t'          |
                              z  }n# t(          $ r Y nw xY w|                    |
          sd}n|j                            |
          sd}|r!|dk    rt,                              d           nF|dk    rt          j        }nt          j
        }|d| dt1          |
           fS |d|d|j        dfS ||j        z   }	n&# t          j        $ r}|d|d|fcY d}~S d}~ww xY wt          j        | |	d           t          j
        d |d!|d"| fS )$a  Write 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.zfile:///zfile '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)r[   timeoutretriesstream   sec_betweeng?s   #cloud-configr*   )
chunk_sizeFr[   zDEPRECATED: `url` kernel command line key is deprecated for providing cloud-config via URL. Please use `cloud-config-url` kernel command line parameter insteadrZ   zcontents of 'z' did not start with zurl 'z' returned code z. Ignoring.zretrieving url 'z
' failed: i  )modezwrote cloud-config data from z='z' to  )r   get_cmdlinerc   r^   loggingDEBUG
startswithr>   r?   existsINFOWARNr   read_file_or_urlok
isinstanceUrlResponsenextiter_contentrK   StopIterationcontentsr/   warningstrcodeUrlError
write_file)r?   networkr_   cmdline_namer[   path_is_localmlevelkwargsra   headerrespsniffed_contentis_cloud_cfges                  r)   attempt_cmdline_urlr      sz   & "$$D-g66cc D D DBCCCCD NN9--D1D1DM --  	! 	! AEcccK  LE &	! AEcccK  LEqzRAFFF $- $ !} #}DF)D*44V447799 "	L$
 677 
%#t))S[[)AA( ( OO %   D&11&99 )#(L]--f55 %$ 5((KK-    #555#LEE#LEKCKKc&kkKK  :=##tyyyI  . D D D333BCCCCCCCD 	OD$U++++<<dd	$ s_   * AAAH5 	3E= <H5 =
F
H5 	F

BH5 H5 *
H5 5I	IIIc                    dt           j        j        t           j        j        fz  }t          j                            | j                            d          d          }t          j        	                    |          rot          |                                          }||k    rFt                              d           |                     d           t          j        ||           dS dS t          j        	                    | j                            d                    rt                              d           t          j        ||           dS )	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.%dra   zpython-versionz-Python version change detected. Purging cacheTobj_pklzMWriting python-version file. Cache compatibility status is currently unknown.N)r"   version_infomajorminorr>   r?   joinpaths	get_cpathru   openreadr/   rL   purge_cacher   r   get_ipath_curinfo)initcurrent_python_versionpython_version_pathcached_python_versions       r)   $purge_cache_on_python_version_changer      s@    %(  ',,
V$$&6  
w~~)** E $%8 9 9 > > @ @ !$:::IIEFFFT"""O/1GHHHHH ;:
 7>>$*229==>> 	HHC   	+-CDDDDDr*   c                 J    t          j        | j        d          rdS |j         S )Ndisable_network_activationF)r   get_cfg_option_boolrW   local)r   rB   s     r)   _should_bring_up_interfacesr     s)    *FGG uz>r*   c                     t           j        t           j        g}|j        rt           j        g}t	          t
          j                            dt          z  d          |j                   g}|j        st          |           }nt          d| z            }t          j        ||j                  }|                    t          |                     d }d }	 |                    t           j        df           t%          j                     t%          j        |j        |           \  }}n\# t,          $ rO d}t%          j        t0          |           t3          |           |                    t           j        |f           Y nw xY w|j        r-t0                              d           t!          j                     t!          j        |j                   t=          |j                   t?          | |	           |D ] \  }	}t0                               |	|           !	 |!                                 n*# t,          $ r t%          j        t0          d
           Y nw xY w|j"        }
tG          |           |j        rt           j$        nt           j%        }|t           j%        k    r6d}tL          j'        (                    dtS          j*                    z             nd}t%          j+        |j        dd          }|rt0                              d           d}nQ|
,                    d          }t
          j        -                    |          rt0                              d|           d}|.                                 t_          ||          }	 |0                    |           |t           j%        k    r5|j1        j2        |k    r%t0                              d||j1                   d g fS n# t           j3        $ r |t           j$        k    rt0                              d           nt%          j        t0          d           |j4        sN|5                    |           t0                              d|           |t           j$        k    rd g fcY S d dgfcY S t0                              d|           Y nw xY wtm          |           |7                                }t0                              d|| ||8                                           |t           j$        k    rts          |dd           |5                    |           |t           j$        k    r[|j1        j2        |k    r*t0                              d||j1                   |j1        g fS t0                              d ||j1                   |:                                 |;                                 ts          |d!d"           	 |<                                =                    d#|j>        t~          gt~          $          \  }}|s|>                    t                     n4# t,          $ r' t%          j        t0          d%           |j1        d%gfcY S w xY wt
          j        -                    |j"        ,                    d&                    rt          |j        ddd'(           nt0                              d)           t=          |j                   t          |t          |          |j        *          }	 |}|}t%          jC        |j        |           \  }}||k    s||k    r9t0          D                    d+||           t%          j        |j        |           \  }}n*# t,          $ r t%          j        t0          d,           Y nw xY wt!          j        |j                   |E                                 t          |j1        |j        -           |j1        t          || |           fS ).Nz%s.dz91_kernel_cmdline_url.cfg)r?   r   z%s-localds_depsreporterzClosing stdin.#Failed to setup output redirection!@Logging being reset, this logger may no longer be active shortlyr'   z0Failed to initialize, likely bad things to come!trustr   checkmanual_cache_cleanFz"manual cache clean set from configmanual_clean_markerz(manual cache clean found from marker: %sexistingz)[%s] Exiting. datasource %s in local modezNo local datasource foundz8No instance datasource found! Likely bad things to come!)bring_upz[%s] Exiting without datasourcezNo instance datasource found.z2[%s] barreling on in force mode without datasourcez5[%s] %s will now be targeting instance id: %s. new=%sr   r   )stageretry_stagez.[%s] Exiting. datasource %s not in local mode.z6[%s] %s is in local mode, will apply init modules now.zinit-netzmodules:configconsume_data)rB   freqzConsuming user data failed!userdata_rawT)configstrictlog_detailslog_deprecationsz2Skipping user-data validation. No user-data found.r   z#Stdout, stderr changing to (%s, %s)z'Failed to re-adjust output redirection!)
datasourcerW   )Hr
   DEP_FILESYSTEMDEP_NETWORKr   r   r>   r?   r   r   r-   r   Initr   read_cfgrE   r=   rr   rs   r   close_stdinfixup_outputrW   	Exceptionlogexcr/   r&   rw   rL   resetLoggingsetupLoggingrX   r1   r   
initializer   r   DSMODE_LOCALDSMODE_NETWORKr"   r#   r$   r   
debug_infor   r   ru   r   r   fetchr   dsmodeDataSourceNotFoundExceptionforceapply_network_config_maybe_persist_instance_data
instancifyis_new_instance_maybe_set_hostnamesetup_datasourceupdatecloudifyrunr   r   r   r   r   get_output_cfgr   activate_datasourcedi_report_warnrS   )rA   rB   deps
early_logsw_msgr   outfmterrfmtr(   lvlpath_helperro   r   mcfgmfilebring_up_interfacesiidran_resultsrF   outfmt_origerrfmt_origs                         r)   	main_initr   #  s>   "G$78Dz (&' 	%'B  
N		
 	
 	
J, : 4t$$zT233;tdm<<<DMM+d##$$$FF/7=*:;<<<,TXt<< / / /3C#7<-.....	/
 z 		N	
 	
 	
 	"""!!!
 De   SSM M M MCKLLLLLM *K(...#':I773IDw%%%
7#5#7#789999'2FNN 	#II:;;;HH--.CDDEw~~e$$ #		DeLLL" 6dDAA

H
%%% 7)))do.D.L.LII;  
 ":.    7'''II12222KO   z 
	%%/B%CCCII7>>>w+++bz!!!>?@@@@IIDd    %, !&&&
//

CII?   w### 	DYGGGG':;;;w###?!T))II@  
 OR((IIH   	KKMMMJ<LMMMMB --//--	 . 
 
h  	* j))) B B BC6777"?!@AAAAB
 
w~~dj..~>>?? H#8!		
 	
 	
 	
 	
 			FGGG!!! 4T**T]CCCDD.tx>>&  K6$9$9KK=vvNNN#04@@VV D D DCBCCCCCD""" 	do48<<<< O/dDAABBsl   AD( (AF FH/ /$IIAO" "B R)R)R)(R)AX8 8.Y)(Y)A&]6 6$^^c                 J   d|vrt                               d           d S |d         }|t                               d           d S t          |t                    st                               d|           d S |                    d          }|t                               d           d S t          |t                    st                               d|           d S | j                            d          d	         }|	                    t          j                  r"|t          t          j                  d          }nt                               d
| |           ||v rt                               d| ||           d S t          j        d||t          |                     d S )N	di_reportzno di_report found in config.zdi_report was None.z%di_report config not a dictionary: %sdatasource_listz(no 'datasource_list' found in di_report.z(di_report/datasource_list not a list: %s.rh   z1Datasource '%s' came from unexpected module '%s'.z:used datasource '%s' from '%s' was in di_report's list: %sdsid_missing_source)sourcedslist)r/   rL   rz   dictr   rU   list
__module__
rpartitionrt   r
   	DS_PREFIXrK   r   show_warningr   )r   rW   dicfgr   modnames        r)   r   r     s   #		1222E} 			'(((eT"" ;UCCCYY())F~>???%% >GGG #..s33A6G'+,, 
#g/00223?	
 	
 	
 &		H		
 	
 	
 	s73v;;     r*   c                    |j         }t          | d|          }t          j        g |j                  }|                    t          |                     	 |                    d           nO# t          j	        $ r= d|z  }t          j        t          |           t          |           |j        s|gcY S Y nw xY wt          |           t!          |t          |          |j                  }	 t                              d           t          j                     t          j        |j        |           n*# t*          $ r t          j        t          d           Y nw xY w|j        r-t                              d	           t-          j                     t-          j        |j                   t3          |j                   t5          ||
           t7          |||          S )N:r   r   r   zGCan not apply stage %s, no datasource found! Likely bad things to come!r   Closing stdinr   r   r'   )ro   r-   r   r   r   r   rE   r   r
   r   r   r   r/   r&   r   r   r   rL   r   r   rW   r   rr   r   r   rX   r1   rS   )rM   rB   rA   r   r   r(   rF   s          r)   main_modulesr   4  s   9D kkk44899E;rDM:::DMM+d##$$$

G
$$$$. 	 	 	 $% 	 	C#z 	7NNN	 		 !&&&4T**T]CCCD@		/"""$(D)))) @ @ @C>?????@z 		N	
 	
 	
 	"""!!! De dD$///s&   A1 1AB=<B=4AD< <$E#"E#c                    |j         }t          |           }t          j        g |j                  }|                    t          |                     	 |                    d           nH# t          j	        $ r6 t          j        t          d           t          d           |j        sY dS Y nw xY wt          |           t!          |t          |          |j                  }|j        }|rt                              d|           |j        }|r5t                              d|           t(                              |          }	 t                              d	           t          j                     t          j        |j        d            n*# t2          $ r t          j        t          d
           Y nw xY w|j        r-t                              d           t5          j                     t5          j        |j                   t;          |j                   t=          | |           |                    |||          \  }}	|	rt                               d|           dS |st                               d|           dS dS )Nr   r   r   z;Failed to fetch your datasource, likely bad things to come!rl   r   zUsing passed in arguments %szUsing passed in frequency %sr   r   r   r'   zRan %s but it failed!zDid not run %s, does it exist?r   )!rA   r-   r   r   r   r   rE   r   r
   r   r   r   r/   r&   r   r   r   module_argsrL   	frequencyFREQ_SHORT_NAMESrU   r   r   rW   r   rr   r   r   rX   r1   
run_singler   )
rA   rB   mod_namer   r   rF   mod_argsmod_freqrP   rQ   s
             r)   main_singler	  k  s    yH4  E;rDM:::DMM+d##$$$

G
$$$$.    	N	
 	
 	
 	I	
 	
 	
 z 	11	 	 !&&&4T**T]CCCDH <		0(;;;~H 2		0(;;;#''11@		/"""$(D)))) @ @ @C>?????@z 		N	
 	
 	
 	"""!!! De !OOHhIIY +X666q 4h???q qs%   A, ,?B10B1
AF $F98F9c                    |#t                      }|                    d          }|t          j                            d          }t          j                            |d          }t          j                            |d          }t          j                            |d          }t          j                            |d          }t          j        ||f           |j        \  }	}
| dk    r|j	        rd}n&d}n#| dk    rd|j
        z  }nt          d	| z            d
}||vr"t          d                    |                    d }|dk    r||||fD ]}t          j        |           n8	 t          j        t          j        |                    }n# t"          $ r Y nw xY wg d d d}|di i}d |d         d<   |D ])}||d         vr|                                |d         |<   *|d         }||d<   t'          j                    ||         d<   t)          j        ||           t          j        t          j                            ||          |d           	  |
| |          }|dv r|\  }}|t1          |          |d<   n|}d |D             ||         d<   n]# t"          $ rP}t          j        t4          d|           t7          d|z             t1          |          g||         d<   Y d }~nd }~ww xY wt'          j                    ||         d<   d |d<   t)          j        ||           |dk    rg }|D ]?}||         d         r/|                    ||                             dg                      @t)          j        |d|d         |di           t          j        t          j                            ||          |d           t=          ||         d                   S )Nra   z/run/cloud-initzstatus.jsonzresult.jsonr   
init-localmodules
modules-%szunknown name: %s)r   r  zmodules-initzmodules-configmodules-finalz'Invalid cloud init mode specified '{0}')errorsstartfinishedv1r   r   r  T)r   )r   r  c                 ,    g | ]}t          |          S rp   )r   ).0r   s     r)   
<listcomp>z"status_wrapper.<locals>.<listcomp>  s    555c!ff555r*   r  zfailed stage %szfailed run of stage %sr  r  )r   r  )r   r   r>   r?   normpathr   r   ensure_dirsr0   r   ro   
ValueErrorr6   del_filejsonloads	load_filer   copytimer   
write_jsonsym_linkrelpathr   r   r/   r&   extendrU   rK   )rA   rB   data_dlink_dr   status_pathstatus_linkresult_pathresult_link_namefunctorro   modesstatusf
nullstatusr   r  retr   r  r   s                         r)   status_wrapperr0    sm   ~  ((~!!"344',,v}55K',,v}55K',,v}55K',,v}55K	
   {UGv~~: 	DDDD			di'+d2333E 55<<TBB
 
 	
 F|{KE 	 	AM!		Z{ ; ;<<FF 	 	 	D	  J ~%)t\" 0 0F4L  (oo//F4LO	BBwK	BtHW[&111M
V,,k   &gdD!!)))#& Z%#&z??< F55f5554 & & &C*D111*T1222!!ffX4&
  9;;BtHZBwK[&111 	7 	7A!uX 7beii"55666 "\"2fEEF	
 	
 	
 	GOOK00+T	
 	
 	
 	
 r$x!"""s,   ,&F 
F F AJ 
K6&AK11K6r   c                     | j         r]| j        rX| j                            d          }t          j                            |          s!| j                             d           dS dS dS dS )zCWrite instance-data.json file if absent and datasource is restored.instance_dataF)write_cacheN)r   ds_restoredr   get_runpathr>   r?   ru   persist_instance_data)r   instance_data_files     r)   r   r   %  s     E4+ E!Z33ODDw~~011 	EO11e1DDDDDE E E E	E 	Er*   c           	      J   |                                  }t          j        | j        |d          \  }}}|rl	 t	          j        d| j        |t          d           dS # t          j        $ r5}t                              d||t          |                     Y d}~dS d}~ww xY wdS )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_onlyzset-hostnameNzGFailed setting hostname in %s stage. Will retry in %s stage. Error: %s.)
r   r   get_hostname_fqdnrW   r   handler/   SetHostnameErrorrL   r   )r   r   r   cloudhostname_fqdn_r   s           r)   r   r   -  s     MMOOE1%t  Xua  
		">48UCNNNNN/ 	 	 	II1A        	
 
s   "A B +*BB c                     t           j                            d                    t	          t
          j                            dz              d S )Nr    )r"   stdoutr$   r   sortedr   FEATURES)rA   rB   s     r)   main_featuresrE  D  s:    JTYYvg&677884?@@@@@r*   c           
         | st           j        } t          j        |                     d                    }|                    ddddt          j                    z   d           |                    d	d
dddt          j        d                     |                    ddddd           |                    ddddd           |	                    d            |
                    dd          }d|_        |                    dd !          }|                    d"d#dd$d           |	                    dt          f%           |                    d&d'!          }|                    d(d)d*d+d,d-.           |	                    d&t          f%           |                    d/d0!          }|                    d1d2d*d3d4           |                    d5d*d6dt          t                                                     7           |                    d8dd9d4           |                    d:d;d<d=>           |	                    d/t$          f%           |                    d?d@!          }|                    t&          j        t&          j        !          }t'          j        |           |                    dAdB!          }|	                    dAt.          f%           |                    dCdD!          }	|                    dEdF!          }
|                    dGdH!          }|                    dIdJ!          }|                    dKdL!          }|                    dMdN!          }| r2| d         }|dCk    rddOlm}  ||	           n|dEk    rddOlm}  ||
           n|dGk    r,ddPlm}m}  ||           |	                    dG|f%           n|dIk    r,ddQlm}m}  ||           |	                    dI|f%           n|d?k    r,ddRlm}m}  ||           |	                    dS|f%           nc|dMk    r,ddTl m}m!}  ||           |	                    dM|f%           n1|dKk    r+ddUl"m}m#}  ||           |	                    dK|f%           |$                    | V          }|j%        \  }}|j&        rtO          j(                     tS          j*                     |dWv rtV          }d }d} |dk    r|j,        rdX\  }}!nLdY\  }}!nF|d&k    rdZ|j-        z  d[|j-        z  }!}n+|d/k    rd\|j.        z  d]|j.        z  }!}|j/        } n	|}d^|z  }!d} ta          j1        ||!| _          |_2        |j2        5  tg          j4        tj          j&        d`|z  d|||fa          }"d d d            n# 1 swxY w Y   tm          j7                     |"S )bNr   )progz	--versionz-vr   z	%(prog)s z'Show program's version number and exit.)r0   r   helpz--filez-fr=   r<   z(Use additional yaml configuration files.rb)r0   destrH  typez--debugz-d
store_truez:Show additional pre-action logging (default: %(default)s).F)r0   rH  defaultz--forcezDForce running even if no datasource is found (use at your own risk).r   )r0   rH  rJ  rM  r   Subcommands
subcommand)titlerJ  Tr   z2Initialize cloud-init and perform initial modules.)rH  z--localz-lz+Start in local mode (default: %(default)s).r9   r  z1Activate modules using a given configuration key.z--modez-mstorez8Module configuration name to use (default: %(default)s).r   )r   r   final)r0   rH  rM  choicessinglezRun a single module.z--namez-nzModule name to run.)r0   rH  requiredz--frequencyzModule frequency for this run.)r0   rH  rU  rS  z--reportzEnable reporting.r  *argumentz0Any additional arguments to pass to this module.)nargsmetavarrH  queryz;Query standardized instance metadata from the command line.featureszList defined features.analyzez-Devel tool: Analyze cloud-init logs and data.develzRun 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.)
get_parser)r`  handle_collect_logs_args)r`  handle_clean_args)r`  handle_argsrender)r`  handle_schema_args)r`  handle_status_args)rB   )r  r   )r  zsearching for local datasources)zinit-networkz!searching for network datasourcesr  zrunning modules for %sz	single/%szrunning single module %szrunning 'cloud-init %s')reporting_enabledzcloud-init mode '%s')logfuncr(   
get_uptimefuncrB   )8r"   argvargparseArgumentParserpopadd_argumentr   r7   FileTypeset_defaultsadd_subparsersrU  
add_parserr   r   r   r  keysr	  r   NAME__doc__r`  rE  cloudinit.analyze.__main__cloudinit.cmd.devel.parsercloudinit.cmd.devel.logsra  cloudinit.cmd.cleanrb  cloudinit.cmd.queryrc  cloudinit.config.schemare  cloudinit.cmd.statusrf  
parse_argsr0   rL   rr   setupBasicLoggingr	   attach_handlersr0  r   ro   rA   reportr   ReportEventStackr   r   log_timer/   r   flush_events)#	sysv_argsparser
subparsersparser_init
parser_modparser_singleparser_queryparser_dhclientparser_featuresparser_analyzeparser_develparser_collect_logsparser_cleanparser_statusparser_schemarO  analyze_parserdevel_parserlogs_parserra  clean_parserrb  query_parserhandle_query_argsschema_parserre  status_parserrf  rB   rA   r*  rname	report_onrdescretvals#                                      r)   mainr  H  s    H	$)--*:*:;;;F w57786     7t$$     I     -   	 	 	 &&&&&]&NNJJ ''I (  K :     VY$7888 &&K '  J G+     I|#<=== ))- *  M "     -%**,,--      	     ?	     x&=>>>((J )  L
 !++!6 ,  O _--- ++1 ,  O   ](C DDD**G +  N ((. )  L %//I 0   ((K )  L ))H *  M ))F *  M  6Nq\
""OOOOOO N>****7""MMMMMM L&&&&>))       
 K+,,,,,&(@A -     7""       
 L&&&%%g7H-I%JJJJ7""       
 L&&&%%h8I-J%KKKK8##       
 M-(((&&x9K.L&MMMM8##       
 M-(((&&x9K.L&MMM),,D kOT7 z $!### "$$$""" EIv~~: 	LLE55LE55 
		49$$ty0  
		$)#&2  K		)D0	+u	  DM 
 
 
I&-
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Ms   <)V11V58V5__main__TZz:/etc/localtime)r   r;   )rY   )TN)NN)Grl  r  r>   r"   r  r%   typingr   	cloudinitr   cloudinit.config.modulesr   patch_loggingr|  r   r   rr   r   r	   r
   r   r   r   r   r   r   cloudinit.reportingr   cloudinit.settingsr   r   r   r   r   cloudinit.configr   r   cloudinit.cmd.develr   r5   rI   r  	getLoggerr/   r&   r1   r-   rE   rS   rX   rc   intr   r   r   r   r   r   r   r	  r0  r   r   r   rE  r  __name__environrk  return_valueexitrp   r*   r)   <module>r     s  $   				 



                  , , , , , ,      ? ? ? ? ? ? $ $ $ $ $ $       $ $ $ $ $ $                                                 & & & & & & O O O O O O O O O O O O # # # # # # , , , , , , # # # # # # . . . . . .
(  %
    g
        
 
 
W    &= = =
K K K Ki iU38_ i i i iXE E E<  \C \C \C~/ / /d40 40 40nD D DNp# p# p# p#fEv{ E E E E  .A A A~ ~ ~ ~B z2:,
44>>L   r*   