__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[h����SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJrJ	r	J
r
Jr SSKJ
r
Jr SSKJr SSKJr SSKJr SSKJr SSKJr SS	KJr SS
KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJrJr SSKJ r  SSK!J"r" SSK#J$r$ SSK%J&r& SSK'J(r( SSK)J*r* SSK+J,r,J-r-J.r.J/r/ \0r1Sr2Sr3\,\-\.S.r4SSSSS .r5\Rl"\75r8SAS!jr9SBS"jr:S#r;\Rx"S$5\8Rz4S%\
\0/S44S&jj5r>S'r?S(\$4S)jr@S*rASCS+jrBSDS,\	\C\044S-jjrDS.rES/rFS0\\\0\G4S,\	\H\144S1jrIS2\\R�S,\	\H\144S3jrKS4rLS5rMS6rNS7rOS8rPS9\R�4S:jrRS;rSS<rTSBS=jrUS>rVS?rW\7S@:Xa#\R�"\U"\R�55 gg)E�N)�Optional�Tuple�Callable�Union)�features�netinfo)�signal_handler)�sources)�socket)�stages)�
url_helper)�util)�performance)�version)�warnings)�	reporting)�
atomic_helper)�	lifecycle)�handlers)�log_util�loggers)�read_cfg_paths)�cc_set_hostname)�Modules)�validate_cloudconfig_schema)�log_with_downgradable_level)�events)�PER_INSTANCE�
PER_ALWAYS�PER_ONCE�CLOUD_CONFIGzOCloud-init v. {version} running '{action}' at {timestamp}. Up {uptime} seconds.zcloud_%s_modules)�instance�always�oncezLocal Stagez
Network StagezConfig StagezFinal Stage)�
init-local�init�modules-config�
modules-finalc��U(a"[RRSU-5 [RRS5 [RRS5 [R"[RS9 [RRS5 [RRS5 g)N�%s
z<------------------------------------------------------------�
)�file)�sys�stderr�write�	traceback�	print_exc��msgs �4/usr/lib/python3/dist-packages/cloudinit/cmd/main.pyr1r1Tsu��
��
�
����3��(��J�J���X���J�J���T��
���S�Z�Z�(��J�J���X���J�J���T��c�f�U(d[U5n[R"SU-SS[S9 U$)Nr*FT)�consoler.�log)�welcome_formatr�	multi_log�LOG)�actionr3s  r4�welcomer=^s,����V�$�����v��~�u�T�s�K��Jr5c��[R[R"5[R
"5[R"5US9$)N)r�uptime�	timestampr<)�WELCOME_MSG_TPL�formatr�version_stringrr?�time_rfc2822�r<s r4r9r9es>���!�!��&�&�(��{�{�}��#�#�%��	"��r5�
Closing stdin�loggerc�|�[R"[RR	55(dlU"S5 [[R5n[R"UR	5[RR	55 SSS5 gU"S5 g!,(df   g=f)z^
reopen stdin as /dev/null to ensure no side effects

logger: a function for logging messages
rFNz"Not closing stdin, stdin is a tty.)�os�isattyr-�stdin�fileno�open�devnull�dup2)rG�fps  r4�close_stdinrQnss���9�9�S�Y�Y�%�%�'�(�(����
�"�*�*�
���G�G�B�I�I�K����!1�!1�!3�4��
�	�3�4��
�s
�AB-�-
B;c���/nUR(aKURH;nUR[RR	UR
55 M= U$�N)�files�appendrI�path�realpath�name)�args�fn_cfgs�fhs   r4�extract_fnsr\}sF���G��z�z��*�*�B�
�N�N�2�7�7�+�+�B�G�G�4�5���Nr5�modsc�R�[U-nURU5upE[U5[U5-nUS:XaDSU<SU<S3n[RRSU-5 [RU5 /$[RS[U5[U55 U$)NrzNo 'z ' modules to run under section '�'r*zRan %s modules with %s failures)�MOD_SECTION_TPL�run_section�lenr-r.r/r;�debug)r]�action_name�section�full_section_name�	which_ran�failures�total_attemptedr3s        r4�run_module_sectionrj�s���'�7�3�� �,�,�->�?��Y��)�n�s�8�}�4�O��!����
��	�
�
����3��(��	�	�#���	��	�	�-�s�9�~�s�8�}�	
��r5c�|�URS5(a&[R"URS55 gg)Nr)�getr�update_configuration)�cfgs r4�apply_reporting_cfgro�s-��
�w�w�{����&�&�s�w�w�{�';�<�r5c��[R"U5nUHnX2;dM
X2U4s $ [SU<SU<S35e)Nz	No keys (z) found in string 'r_)r�keyval_str_to_dict�KeyError)�cmdline�names�data�keys    r4�parse_cmdline_urlrw�s?���"�"�7�+�D����;��S�	�>�!���'�5�I�
J�Jr5�returnc��Uc[R"5n[U5up4UR
S5nU(a~[RRU5(aZU(a5SU<SU<S3n[RnU(a[R
nXv4$SU<SU<S3n[RnXv4$USS	S
S.nU(dU(a[RnSUS
'O[R
nSUS
'Sn	Sn
[R"S%0UD6nSnUR5(a�S
n
[U[R 5(a>U[#UR%['U
5S95-
nUR
U
5(dSn
O"UR*R
U
5(dSn
U
(aUS:Xa[,R."SSSS
S9$OQUS:Xa[RnO[RnUSUS[1U
534$USU<SUR2<S34$X�R*-n	[R6"X	S S!9 [RS"U<S#U<S$U<34$![a [R
S4s$f=f![(a GN!f=f![R4anUSU<SU<34sSnA$SnAff=f)&abWrite 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)�url�timeout�retries�stream��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��
deprecated�deprecated_version�
extra_message�skip_log�cloud-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_cmdlinerwrr�logging�DEBUG�
startswithrIrV�exists�INFO�WARNr
�read_file_or_url�ok�
isinstance�UrlResponse�next�iter_contentrb�
StopIteration�contentsr�	deprecate�str�code�UrlError�
write_file)rV�networkrs�cmdline_namer}�
path_is_local�m�level�kwargsru�header�resp�sniffed_content�is_cloud_cfg�es               r4�attempt_cmdline_urlr��s���&���"�"�$��D�-�g�6����N�N�#3�4�M��������-�-��AE�c�K�
��L�L�E���
�
���z���AE�c�K�
��L�L�E��z���R�A��
F�F��-����� !��}���
�
�� #��}���D�
�F�*D��*�*�4�V�4�����7�7�9�9��L��$�
� 6� 6�7�7��#�t��)�)�S��[�)�A�(��O�
'�1�1�&�9�9�#(�L���]�]�-�-�f�5�5�$����5�(�$�.�.�#F�+1�'@�!%���)� �#5�5�#�L�L�E�#�L�L�E��#�C�5�(=�c�&�k�]�K����:=�t�y�y�I��
����.��
	�O�O�D�U�+������d�	$����]�D��
�
�B�C�C�D��V%�����>���D��3��B�C�C��D�sg�
I'�AJ�$J	�5AJ�:J�J�&J�'J�J�	
J�J�J�J�K�.J?�9K�?Kc��S[RR[RR4-n[R
R
URRS5S5n[R
RU5(aY[R"U5nX1:wa=[RS5 URS5 [R"X!5 gg[R
RURR!S55(a[R#S5 [R"X!5 g)	z�Purge 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 cacheT�obj_pklzMWriting python-version file. Cache compatibility status is currently unknown.N)r-�version_info�major�minorrIrV�join�paths�	get_cpathr�r�load_text_filer;rc�purge_cacher��
get_ipath_cur�info)r&�current_python_version�python_version_path�cached_python_versions    r4�$purge_cache_on_python_version_changer�s���%�����������(����'�'�,�,��
�
���V�$�&6���
�w�w�~�~�)�*�*� $� 3� 3�4G� H��!�:��I�I�E�F����T�"��O�O�/�H�;�
�7�7�>�>�$�*�*�2�2�9�=�>�>��H�H�C�
�	
���+�Dr5c�r�[R"URS5(agUR(+$)N�disable_network_activationF)r�get_cfg_option_boolrn�local)r&rYs  r4�_should_bring_up_interfacesr�5s)��������*F�G�G���z�z�>�r5�
raw_configc	��U(dg[R"UR5SS5S:wag[R"U5n[U[5(dg
SU;aYUSHPnURS5=(d 0nURS
S5nU(dM8URS5(aMP g URS5(agURS05RS5(agURS5(agg![
a*n[
[S[RSU4S9 SnAg	SnAff=f)arDetermine 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)rGr�requested_levelr3rY)Tz!failed to parse user data as yaml)Tz(parsed config not in cloud-config format�write_files�source�uri�)rzzfile:)Tz!write_files with source uri found�bootcmd)Tz
bootcmd found�random_seed�command)Tzrandom_seed command found�mounts)Tzmounts found)Fz8cloud-config does not contain network requiring elements)r�type_from_starts_with�strip�yaml�	safe_load�	Exceptionrr;r��WARNINGr��dictrlr�)r��parsed_yamlr��item�source_dict�
source_uris      r4�_should_wait_via_user_datar�;s,���.�	�&�&�z�'7�'7�'9�#�2�'>�?��	�8�
9��n�n�Z�0���k�4�(�(�?���#��
�.�D��(�(�8�,�2��K�$�����3�J��z�:�#8�#8��#H�#H�@�	/�
���y�!�!�$����}�b�)�-�-�i�8�8�0����x� � �#�L��5�9�#���#�O�O�9���	
�9��9�s�D�
E�! E�E�
datasourcec�"�U(dg[UR55upU(aSUS34$[UR55up4U(aSUS34$[UR55upVU(aSUS34$SSUSUS	U34$)
z�Determine 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 data2Fzuser data: z, vendor data: z, vendor data2: )r��get_userdata_raw�get_vendordata_raw�get_vendordata2_raw)r��user_should_wait�user_reason�vendor_should_wait�
vendor_reason�vendor2_should_wait�vendor2_reasons       r4�_should_wait_on_networkr�vs����*�$>��#�#�%�%�!�����}�M�2�2�2�(B��%�%�'�)�%����
��o�6�6�6�*D��&�&�(�+�'�����'�'7�8�8�8�	��+��'�)�?�+�+�,�
.��r5c�r^�[R[R/nUR(a[R/n[	[
RRS[-S5UR(+S9/mUR(aSOSn[U5n[R"X!RS9nUR[U55 SnSnUR(d3[!U4Sj5 ["R$"UR&U5upgO$["R("UR&U5upgUR8(a*[.R9S	5 [:R<"5 UR(d5[:R>"UR&5 [AUR&5 [CXS
9 [.RES[
RF"5U5 THup�[.RIX�5 M URK5 URLn
[OU5 UR(a[RPO[RRnU[RR:Xa�[TRV(al[
RRYURLR[S
55(d/[.R9S5 UR\R_5 Sn[`RbReS[fRh"5-5 O�Sn["Rj"UR&SS5n
U
(a[.R9S5 SnOMU
RmS5n[
RRYU5(a[.R9SU5 SnURo5 [qXQ5nURsUS9 U[RR:Xa?URtRvU:wa%[.R9SUURt5 S/4$[U5 UR�5n[.R9SUUUUR�55 U[RP:Xa[�US S!S"9 UR}US9 U[RP:Xa�[TRV(a|[�URt5unnU(a[.R9S#U5 OF[.R9S$U5 ["R�"URLR[S
5S%5 URtRvU:wa/[.R9S&UURt5 URt/4$[.R9S'UURt5 UR�5 UR�5 [�US(S)S"9 UR�5R�S*UR�[�/[�S+9unnU(dUR�[�5 URLRmS-5n[
RRYU5(aY[
R�"U5R�S.:wa5[�[�R�"["R�"U55SSS/S09 O[.R9S15 [AUR&5 [�U[U5URS29nUnUn["R("UR&U5upgUU:wdUU:wa9[.R�S3Xg5 ["R$"UR&U5upg[:R>"UR&5 UR�5 [�URtUR&S59 URt[�UX54$![*aM Sn["R,"[.U5 [1U5 TR3[4R6U45 GNf=f![*a ["R,"[.S5 GNUf=f![Rxa� U[RP:Xa[.R9S5 O["R,"[.S5 URz(dFUR}US9 [.R9SU5 U[RP:XaS/4s$SS/4s$[.R9SU5 GN�f=f![*a- ["R,"[.S,5 URtS,/4s$f=f![*a ["R,"[.S45 GNf=f)6Nz%s.dz91_kernel_cmdline_url.cfg)rVr�r%r&��ds_deps�reporterc�F>�TR[RU45$rS)rUr�r�)r3�
early_logss �r4�<lambda>�main_init.<locals>.<lambda>�s���J�$5�$5�w�}�}�c�6J�$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 continuing�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 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=%sr�r�)�stage�retry_stagezTNetwork connectivity determined necessary for cloud-init's network stage. Reason: %szVNetwork connectivity determined unnecessary for cloud-init's network stage. Reason: %sr�z.[%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)rY�freqzConsuming user data failed!�cloud_configrT)�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!)r�rn)Wr
�DEP_FILESYSTEM�DEP_NETWORKr�r�rIrVr�r!r9r�Initr��read_cfgr\�skip_log_setuprQr�fixup_outputrn�get_output_cfgr��logexcr;r1rUr�r�rcr�
reset_logging�
setup_loggingror=r��getppidr8�
initializer�r��DSMODE_LOCAL�DSMODE_NETWORKr�MANUAL_NETWORK_WAITr��get_runpath�distro�wait_for_networkr-r.r/r�
debug_infor�r�r�r��fetchr��dsmode�DataSourceNotFoundException�force�apply_network_config�_maybe_persist_instance_data�
instancify�is_new_instance�_maybe_set_hostnamer�r��setup_datasource�update�cloudify�runr�rr�stat�st_sizerr�r�r�r�warning�activate_datasource�di_report_warnrj)rXrY�deps�bootstage_name�w_msgr&�outfmt�errfmtr3�lvl�path_helperr�r��mcfg�mfile�bring_up_interfaces�iid�should_wait�reason�ran�_results�cloud_cfg_pathr]�outfmt_orig�errfmt_origr�s                         @r4�	main_initr8�sk����"�"�G�$7�$7�8�D��z�z��&�&�'��	��������%�'B���
�
�N�		
��J�,&*�Z�Z�\�V�N��>�*�E��;�;�t�m�m�<�D��M�M�+�d�#�$�
�F�
�F�
/��"�"��K�L�!�.�.�t�x�x��>�N�F�F�!�0�0����4�@�N�F�F��z�z��	�	�N�	
�	����������d�h�h�'��D�H�H�%�
�D���H�H�
0�"�*�*�,��O����������M������*�*�K�(��.�#'�:�:�7���7�3I�3I�D��w�%�%�%��'�'�������J�J�"�"�?�3�1
�1
�
�I�I�L�M��K�K�(�(�*����
�
����7�#5�#5�#7�8�9����'�'����2F��N����I�I�:�;��H��-�-�.C�D�E��w�w�~�~�e�$�$��	�	�D�e�L�"������6�d�A����
�
�H�
�%��7�)�)�)�d�o�o�.D�.D��.L��I�I�;�����
�
�"�:��.!��&�
�/�/�
�C��I�I�?����������w�#�#�#�	�D��Y�G����':��;��w�#�#�#��'�'�"9�$�/�/�"J��K����	�	�=����	�	�=���
����
�
� 6� 6�� G��L��?�?�!�!�T�)��I�I�@�����
�
�O�O�R�(�(��I�I�H�����
�	�����K�K�M���J�<L�M�B��-�-�/�-�-��������	.�
���h��
���j�)��Z�Z�-�-�n�=�N�	�w�w�~�~�n�%�%�"�'�'�.�*A�*I�*I�Q�*N�#��>�>�$�"5�"5�n�"E�F���!�		
�	�	�	�F�G�����!��4��T�*�T�]�]�C�D�D������.�.�t�x�x��>����&� �K�6�$9��K�K�=�v�N�#�0�0����4�@��V����$�(�(�#�	�����d�o�o�4�8�8�<�
�O�O�/��d�A�B�B��Y�/�3�����C����#�����7�<�<��-�.�	/��8�M����C�K�L�M��T�.�.���7�'�'�'��I�I�1�2��K�K��O�
��z�z��%�%�/B�%�C��I�I�7��>��w�+�+�+��b�z�!��>�?�@�@��I�I�D�d�
�%��@�B����C�6�7����"?�!@�A�A�B��8�D����C�B�C�D�sr� A`�$#`�a�.A!b�;Ae�.A,f
�Aa�a�%b�b�B'e�/e�6e�e�4f
�	f
�
%f6�5f6c���SU;a[RS5 gUSnUc[RS5 g[U[5(d[R	SU5 gURS5nUc[R	S5 g[U[5(d[R	SU5 gURRS5S	nUR[R5(aU[[R5SnO[R	S
UU5 XC;a[RSUUU5 g[R"SX[U5S
9 g)N�	di_reportzno di_report found in config.zdi_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�.r|z1Datasource '%s' came from unexpected module '%s'.z:used datasource '%s' from '%s' was in di_report's list: %s�dsid_missing_source)r��dslist)r;rcr�r�r#rl�list�
__module__�
rpartitionr�r
�	DS_PREFIXrbr�show_warningr�)r�rn�dicfgr>�modnames     r4r%r%�s<���#���	�	�1�2�����E��}�	�	�	�'�(���e�T�"�"����;�U�C��
�Y�Y�(�
)�F�
�~����>�?��
���
%�
%����>��G���#�#�.�.�s�3�A�6�G����'�+�+�,�,��#�g�/�/�0�2�3�����?���	
����	�	�H����		
�	�����s�3�v�;�r5c�h�URnU<SU<3n[U5n[R"/URS9nUR[
U55 URSS9 [U5 [!U[
U5URS9nUR"(d+[%5 [R&"UR(U5 UR,(a*[R-S5 [.R0"5 UR"(d5[.R2"UR(5 [5UR(5 [7X$S	9 [R9S
[:R<"5U5 US:Xa[>R@"SS
SS9 [CXrU5$![RaE SU-n[R"[U5 [U5 UR(dU/s$GN�f=f![*a [R"[S5 GN`f=f)N�:r�r�r�zGCan not apply stage %s, no datasource found! Likely bad things to come!rr�r�r2r�r&z
`--mode init`�24.1�Use `cloud-init init` instead.)r�r�r�)"r�r9rrr�rr\rr
rrrr;r1rrrrrQrrnr�rcrr	r
ror=r�rIrrr�rj)rdrYrXr'r(r&r3r]s        r4�main_modulesrJ�s����9�9�D�!,�T�2�N��>�*�E��;�;�r�D�M�M�:�D��M�M�+�d�#�$���
�
�G�
�$�!��&��4��T�*�T�]�]�C�D�@��"�"��M����d�h�h��-��z�z��	�	�N�	
�	����������d�h�h�'��D�H�H�%��D���H�H�
0�"�*�*�,��O��v�~����&�%�:�	
��d�$�/�/��U�.�.�	�
� $�
%�	�	
���C����#���z�z��7�N��	��$�@����C�>�?�@�s%�F,�<H�,AH�H�%H1�0H1c���URn[U5n[R"/URS9nUR[
U55 URSS9 [U5 [!U[
U5URS9nUR"nU(a[R%SU5 UR&nU(a+[R%SU5 [(R+U5n[-5 [R."UR0S5 UR$(a*[R%S
5 [4R6"5 [4R8"UR05 [;UR05 [=XS9 UR?X&U5up�U	(a[RASU5 gU(d[RAS
U5 gg![Ra= [R"[S5 [S5 UR(dgGN�f=f![2a [R"[S	5 GNFf=f)Nr�r�r�z;Failed to fetch your datasource, likely bad things to come!r�rzUsing passed in arguments %szUsing passed in frequency %sr�r�r2zRan %s but it failed!zDid not run %s, does it exist?r)!rXr9rrr�rr\rr
rrrr;r1rrr�module_argsrc�	frequency�FREQ_SHORT_NAMESrlrQrrnr�rr	r
ror=�
run_singler#)
rXrY�mod_namer(r&r]�mod_args�mod_freqrgrhs
          r4�main_singlerSs����y�y�H��4� �E��;�;�r�D�M�M�:�D��M�M�+�d�#�$�
��
�
�G�
�$�!��&��4��T�*�T�]�]�C�D����H���	�	�0�(�;��~�~�H���	�	�0�(�;�#�'�'��1��@��
����$�(�(�D�)��z�z��	�	�N�	
�	�������$�(�(�#�����!��D��!�O�O�H��I��Y�����+�X�6��
����4�h�?����e�.�.��	
����N�	
�	�I�	
��z�z�����4�@����C�>�?�@�s%�G'�2+H;�'AH8�7H8�;%I$�#I$c
�
�[5nURS5n[RR	UR
5n[RR
US5n[RR
US5n[RR
US5n[RR
US5n[R"5n	[R"UU45 URup�US:XaUR(aSnO'SnO$US:XaSUR-nO[SU-5eU[;a[S	R!U55e/0SSS
.n
SSU
R#5U
R#5U
R#5U
R#5S.0nUS:Xa"XhXW4Hn[R$"U5 M O+[&R("[R*"U55nX�S;aU
R#5USU'USnUUS
'UUS(a*UUS(d[.R1S[U5 [3[R4"55UUS'[7[9SU	R:55nUR=5n[>R@"X^5 [RB"[RREXT5USS9 U"X5nUS;aUunnUb[GU5US'OUnUUSRIUVs/sHn[GU5PM sn5 [3[R4"55UUS'SUS
'UR=5nURU5 URW5H?nUU;a([Y[[UUUU-55UUSU'M1UUUUSU'MA [>R@"X^5 US:Xa�/nURW5H\n[]UU[^5(dMUURaS5(dM8URIUURaS/55 M^ [>R@"USUSUS.05 [RB"[RREXt5USS9 [cUUS5$![,a GN�f=fs snf![,aOn[.RKSU5 [MSU-5 UUSRO[GU55 SnAGN�SnAf[PannURR(aR[.RKSU5 [MSU-5 UUSROS[GURR5S35 SnAGNmSnAff=f![3[R4"55UUS'SUS
'UR=5nURU5 URW5H?nUU;a([Y[[UUUU-55UUSU'M1UUUUSU'MA [>R@"X^5 f=f)Nruzstatus.jsonzresult.jsonr&r%�modules�
modules-%szunknown name: %sz'Invalid cloud init mode specified '{0}')�errors�recoverable_errors�start�finished�v1)r�r&r%r'r(r�rYrZz=Unexpected start time found for %s. Was this stage restarted?c�6�[U[R5$rS)r�r�LogExporter)�hs r4r�� status_wrapper.<locals>.<lambda>�s��j��G�$7�$7�8r5T)r)r&r%r�rWzfailed stage %szfailed run of stage %sz	sys.exit(z) calledrXr()r�rW)2rr�rIrV�normpath�run_dirr�r��	getLoggerr�ensure_dirsr<r�r��
ValueError�
STAGE_NAMErB�copy�del_file�json�loadsr�r�r;r#�floatr?r��filterr�export_logsr�
write_json�sym_link�relpathr��extend�	exceptionr1rU�
SystemExitr��
clean_logs�keysr?�setr�r�rlrb)rXrYr��data_d�link_d�status_path�status_link�result_path�result_link�root_logger�_name�functorr��
nullstatus�status�fr[�handler�preexisting_recoverable_errors�retr�rWr��new_recoverable_errorsrvr�s                          r4�status_wrapperr�Ls�����E�
�_�_�V�
$�F�
�W�W�
�
�e�m�m�
,�F��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��#�#�%�K������	
���{�{��U��v�~��:�:��D��D�	
��	��d�i�i�'���+�d�2�3�3��:���5�<�<�T�B�
�	
�
� ���	�J�	
���O�O�%�$�/�/�+�(�o�o�/�'�_�_�.�
��F��|���K�E�A��M�M�!��F�	��Z�Z�� 3� 3�K� @�A�F��$�<��'�_�_�.��t��T��	���B��B�w�K�	�$�x����D��*�!5����K��t��	
�
�d�k�k�m�,�B�t�H�W����8�+�:N�:N�	
��G�
&-�%8�%8�%:�"����[�1��M�M�
������,�k���16��d�!���)�)�#&� �Z���%�#&�z�?��<� ���F�
�4����!�!�6�":�6�a�3�q�6�6�":�;�( %�T�[�[�]�3��4������7��")�!4�!4�!6������)�.�.�0�C��4�4�6:��6�s�;�0��5�6��7��4��-�.�s�3�7M��7��4��-�.�s�3�1�	� � ��5����������A��"�Q�%��&�&�2�a�5�9�9�X�+>�+>��
�
�b��e�i�i��"�5�6��	� � ��
�"�\�"2�f�E�F�	
�	
�
�
��G�G�O�O�K�0�+�T�	
��r�$�x��!�"�"��A�	��	��N#;���*��
�
�'��.��*�T�1�2�
�4����!�!�#�a�&�)�)���	I�
�6�6�
�M�M�+�T�2��.��5�6��t�H�X��%�%�	�#�a�f�f�+��h�&G�H���	I�� %�T�[�[�]�3��4������7��")�!4�!4�!6������)�.�.�0�C��4�4�6:��6�s�;�0��5�6��7��4��-�.�s�3�7M��7��4��-�.�s�3�1�	� � ��5�sc�*S#�><S9�:S4�S9�#
S1�0S1�4S9�9
W�AU
�W�

W�A#W�=W�W�W�B4Y?r&c��UR(alUR(aZURRS5n[R
R
U5(dURRSS9 gggg)zCWrite instance-data.json file if absent and datasource is restored.�
instance_dataF)�write_cacheN)r��ds_restoredr�rrIrVr��persist_instance_data)r&�instance_data_files  r4rr�s[�����4�+�+�!�Z�Z�3�3�O�D���w�w�~�~�0�1�1��O�O�1�1�e�1�D�2�,�r5c	�F�UR5n[R"URUSS9upEnU(a%[R
"SURUS5 gg![Ra+n[RSUU[U55 SnAgSnAff=f)z�Call 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.)
rr�get_hostname_fqdnrnr�handle�SetHostnameErrorr;rcr�)r&r�r��cloud�hostname�_fqdn�_r�s        r4rr�s���
�M�M�O�E��1�1����%�t���X�a��		��"�"�>�4�8�8�U�D�I����/�/�	��I�I�1����A��
�
��	�s�#A!�!B �5!B�B c��[RRSR[	[
R55S-5 g)Nr+)r-�stdoutr/r��sortedr�FEATURES)rXrYs  r4�
main_featuresr�s-���J�J���T�Y�Y�v�g�&6�&6�7�8�4�?�@r5c
��[R"5 U(d[Rn[R
"UR
S5S9nURSSSS[R"5-SS9 URS	S
SSS
S9 URSSSSS
S9 URSSSSS
S9 URSS9 URSSS9nURSSS9nURSSSS S
S9 URS!S"S#S$S%[R"S&5S'9 URS[4S(9 URS)S*S9n[R "S+S,S-S.S/9R"nURS0S1S2S3U3S4S5S69 URS!S"S#S$S%[R"S&5S'9 URS)[$4S(9 URS7S8S9nURS9S:S2S;S.S<9 URS=S2S>S
['[(R+55S?9 URS@SSAS
S<9 URSBSCSDSESF9 URS!S"S#S$S%[R"S&5S'9 URS7[,4S(9 URSGSHS9nURSISJS9nURSI[.4S(9 URSKSLS9n	URSMSNS9n
URSOSPS9nURSQSRS9nURSSSTS9n
URSUSVS9nU(Ga[1SWU5S5nUSK:XaSSXKJn U"U	5 O�USM:XaSSXKJn U"U
5 O�USO:Xa SSYKJnJn U"USZ9 URSOU4S(9 O�USQ:Xa"SS[KJnJn U"U5 URSQU4S(9 O�USG:Xa"SS\K JnJ!n U"U5 URS]U4S(9 OaUSU:Xa"SS^K"JnJ#n U"U5 URSUU4S(9 O9USS:Xa!SS_K$JnJ%n U"U
5 U
RSSU4S(9 OURMS`5 UROUSa9n[QUSbS
5 URR(d[UU5$[SU5$)cNr)�progz	--versionz-vrz	%(prog)s z'Show program's version number and exit.)r<r�helpz--debugz-d�
store_truez:Show additional pre-action logging (default: %(default)s).F)r<r��defaultz--forcezDForce running even if no datasource is found (use at your own risk).r)r<r��destr�z--all-stages�
all_stageszsRun cloud-init's stages under a single process using a syncronization protocol. This is not intended for CLI usage.)r�r<r�r�r�Subcommands�
subcommand)�titler�r&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<r�r��typerErUz1Activate modules using a given configuration key.z`init`rHrITr�z--modez-m�storez9Module configuration name to use (default: %(default)s). r�)r&r��final)r<r�r��choices�singlezRun a single module.z--namez-nzModule name to run.)r<r��requiredz--frequencyzModule frequency for this run.)r<r�r�r�z--reportzEnable reporting.rL�*�argumentz0Any additional arguments to pass to this module.)�nargs�metavarr��queryz;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.c3�T# �UHoRS5(aMUv� M  g7f)�-N)r�)�.0�posargs  r4�	<genexpr>�main.<locals>.<genexpr>�s���J�)��3D�3D�S�3I�V�V�)�s�(�	()�
get_parser)r��handle_collect_logs_args)�parser)r��handle_clean_args)r��handle_args�render)r��handle_schema_args)r��handle_status_argsza subcommand is required�rYr)+r�configure_root_loggerr-�argv�argparse�ArgumentParser�pop�add_argumentrrC�set_defaults�add_subparsers�
add_parser�FileTyper8rr��messagerJr?rNrtrSr�r��cloudinit.analyzer��cloudinit.cmd.devel.parser�cloudinit.cmd.devel.logsr��cloudinit.cmd.cleanr��cloudinit.cmd.queryr��cloudinit.config.schemar��cloudinit.cmd.statusr��error�
parse_args�setattrr��sub_main)�	sysv_argsr��
subparsers�parser_init�
parser_mod�
extra_help�
parser_single�parser_query�parser_features�parser_analyze�parser_devel�parser_collect_logs�parser_clean�
parser_status�
parser_schemar��analyze_parser�devel_parser�logs_parserr��clean_parserr��query_parser�handle_query_args�
schema_parserr��
status_parserr�rYs                             r4�mainr�
s����!�!�#���H�H�	�
�
$�
$�)�-�-��*:�
;�F��������w�5�5�7�8�
6���������
I���������
-����	�����
��
K���	������&��&�&�]��&�N�J��'�'��I�(��K�������
:����������
�
7�
�
�
�t�
$�
�����V�Y�$7��8��&�&��K�'��J��$�$��!�6��	�
�g����������|�
��+��
�������
�
7�
�
�
�t�
$�
�����I�|�#<��=��)�)��-�*��M�������
"���������
-���%�*�*�,�-��������
 ��	��������
?�	��������
�
7�
�
�
�t�
$�
�����x��&=��>��(�(��
J�)��L�
!�+�+��1�,��O�� � ��]�(C� �D��*�*��G�+��N��(�(��.�)��L�%�/�/��I�0����(�(��K�)��L��)�)��H�*��M��)�)��F�*��M���J�)�J��
�
���"�F�
�>�*�
�7�
"�M�
��&�
�>�
)�
�

�2�3��,�,�&�(@�A�
-�
��7�
"�
�

��&��%�%�g�7H�-I�%�J�
�7�
"�
�

��&��%�%�h�8I�-J�%�K�
�8�
#�
�

�-�(��&�&�x�9K�.L�&�M�
�8�
#�
�

�-�(��&�&�x�9K�.L�&�M�����/�0����)��,�D��D�"�E�*��?�?���~���f��r5c��[RS5 [R"SSSS5n[R"S5 U"S5 URSS/S	9nS
Ul[U5UlSSS5 U"S5 URS/S	9nSUl[U5UlSSS5 U"S5 URS
S/S	9nSUl[U5UlSSS5 U"S5 URS
S/S	9nSUl[U5UlSSS5 UR(aSSnUR(aSUR3n[R"SUS35 [R"S5 g[R"S5 [R"S5 g!,(df   GNJ=f!,(df   GN$=f!,(df   N�=f!,(df   N�=f)z>Run all stages in a single process using an ordering protocol.z*Running cloud-init in single process mode.r�r�r�r�zREADY=1r&r�r�FNTrUz
--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=1r�zSTATUS=Completed)r;r�r�
SocketSync�	sd_notifyr�rr��systemd_exit_code�experienced_any_error�first_exception)r��syncrYr�s    r4r�r��s����H�H�
9�:����W�i��7�C�D����Y��	
�g��� � �v�y�&9� �:��#���!)�$����
�
�i��� � �v�h� �/��"���!)�$����
�
�h��� � �y�/�&B� �C��"���!)�$����
�
�g��� � �y�.�&A� �B��"���!)�$����
��!�!�9�����2�4�3G�3G�2H�I�G����-�g�Y�7)�
)�	
�	����&�����+�,�����&�[
���
���
���
��s0�
)F9�(G�>)G�7)G.�9
G�
G�
G+�.
G<c���URupUS;aF[R"UR(a[R
O[R5 O&UR(a[R"5 [R"5 SU:XdSU:XaSUR:wa[nSnSnUS:XaUR(aSup5ObSup5O]US:XaSUR-SUR-pSO9US	:Xa*S
UR-SUR-pSURnO	UnSU-nS
n[R"X5US9UlUR  ["R$"SUS35 U"X5nSSS5 SSS5 [&R("5 SU:XaSUR:Xa[+W5nW$!,(df   NN=f!,(df   NW=f)N)r&rUr&rUT)r%zsearching for local datasources)zinit-networkz!searching for network datasourcesrVzrunning modules for %sr�z	single/%szrunning single module %szrunning 'cloud-init %s'F)�reporting_enabledzcloud-init stage: 'r_)r<r�setup_basic_loggingrcr�r�r�r	�attach_handlersr�r�r�rX�reportr�ReportEventStackr�r�Timedr�flush_eventsrb)rYrXr~�rname�	report_on�rdesc�retvals       r4r�r�7s����k�k�O�T��&�&��#�#�!�Z�Z�G�M�M�W�_�_�	
�
����#�#�%��"�"�$�
��~�)�t�+��$�)�)�0C� ���E��I��v�~��:�:�L�L�E�5��L�E�5�
��	��4�9�9�$�$�t�y�y�0��
��	��$�)�)�#�&����2���K�K�	���)�D�0���	��+�+�
�	��D�M�
���
�
�
�!4�U�G�1�=�
>��T�(�F�?�
������D��V�t�y�y�0��V����M�?�
>��
��s$� G�;	G�G�
G	�G�
G+�__main__)r�rS))r�r})TN)Zr�rhrIr-r0r�r��typingrrrr�	cloudinitrrr	r
rrr
rrrrrrrr�
cloudinit.logrr�cloudinit.cmd.develr�cloudinit.configr�cloudinit.config.modulesrr�r�cloudinit.lifecycler�cloudinit.reportingr�cloudinit.settingsrrr r!r��ReasonrAr`rNrerb�__name__r;r1r=r9�timedrcrQr\rjrorw�intr�r�r��bytes�boolr��
DataSourcer�r8r%rJrSr�rrrr�r�r�r��exitr�r�r5r4�<module>rs����	�
����3�3�'�$���� ��!����#���+�.�,�,�?�;�&���

��(��%��
����� ��$�"�	�
�����!��
���
���?�#�03�	�	�5��#����-�5�$�5�
��W��&=�
K�j�U�3��8�_�j�ZE�<�8M���s�E�z�*�+�8M�
�4��<��8M�v"���+�+�,�"�
�4��<��"�JuC�p/�d>0�BC�LX#�vE�v�{�{�E��.A�o�d8'�vB�J�z���H�H�T�#�(�(�^��r5

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 153 B 0644
clean.cpython-313.pyc File 7.02 KB 0644
cloud_id.cpython-313.pyc File 4.74 KB 0644
main.cpython-313.pyc File 49.61 KB 0644
query.cpython-313.pyc File 11.2 KB 0644
status.cpython-313.pyc File 20.12 KB 0644
Filemanager