403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/sources/__pycache__/__init__.cpython-314.pyc
+
��i����^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIHtH	t	^RI
HtHtH
t
HtHtHtHtHt^RIHtHtHtHtHtHtHtHtHt^RIHt^RIH t ^RI!H"t"H#t#^RI$H%t%^R	I&H't'^R
I(H)t)^RI*H+t+Rt,R
t-Rt.Rt/],]-]..t0Rt1Rt2Rt3Rt4Rt5Rt6Rt7Rt8]Pr!]:4t;RRR3RRR3RRR 3/t<]	!R!R"]44t=!R#R$]4t>!R%R&]?4t@!R'R(]?4tA!R)R*]?4tBRHR+ltC]53R,ltD!R-R.]4tE!R/R0]4tF!R1R2]4tG!R3R])]P�R47tIR5tJR6R7ltKR8tLRIR9R:lltMR;tNRJR<ltO!R=R>]P4tQR?tRR@RAltSRBRCltTRDREltURFRGltVR#)K�N)�Enum�unique)�Any�Dict�List�
NamedTuple�Optional�Tuple�Union�cast)	�
atomic_helper�dmi�importer�	lifecycle�net�performance�
type_utils�	user_data�util)�
write_json)�Distro)�
EventScope�	EventType)�launch_index)�Paths)�CloudInitPickleMixin)�events�disabled�localr�pass�
FILESYSTEM�NETWORK�
DataSourcez|EXPERIMENTAL: The structure and format of content scoped under the 'ds' key may change in subsequent releases of cloud-init.zredacted for non-root user�
cloud-name�_unset�unknownzcn-z	aws-chinac��VR8H#��aws���cs&�</usr/lib/python3/dist-packages/cloudinit/sources/__init__.py�<lambda>r.Fs��1��:�zus-gov-zaws-govc��VR8H#r(r*r+s&r-r.r.Gs��Q�%�Zr/�chinazazure-chinac��VR8H#)�azurer*r+s&r-r.r.Hs��q�G�|r/c�Ja�]tRt^LtoRtRtRtRtRtRt	V3RlRlt
R	tVtR
#)�NetworkConfigSourcezV
Represents the canonical list of network config sources that cloud-init
knows about.
�cmdline�ds�
system_cfg�fallback�	initramfsc� <�V^8�dQhRS[/#���return��str)�format�
__classdict__s"�r-�__annotate__� NetworkConfigSource.__annotate__Y�������r/c��VP#�N��value��selfs&r-�__str__�NetworkConfigSource.__str__Y����z�z�r/r*N)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__�CMD_LINE�DS�
SYSTEM_CFG�FALLBACK�	INITRAMFSrL�__static_attributes__�__classdictcell__�rBs@r-r5r5Ls/�����
�H�	
�B��J��H��I��r/r5c�>a�]tRt^]toRtRtRtV3RlRltRtVt	R#)�NicOrderzRepresents ways to sort NICs�mac�nic_namec� <�V^8�dQhRS[/#r<r?)rArBs"�r-rC�NicOrder.__annotate__crEr/c��VP#rGrHrJs&r-rL�NicOrder.__str__crNr/r*N)
rOrPrQrRrS�MAC�NIC_NAMErLrYrZr[s@r-r]r]]s����&�
�C��H��r/r]c��]tRt^gtRtRtR#)�DatasourceUnpickleUserDataErrorzERaised when userdata is unable to be unpickled due to python upgradesr*N�rOrPrQrRrSrYr*r/r-rgrggs��Or/rgc��]tRt^ktRtR#)�DataSourceNotFoundExceptionr*N�rOrPrQrRrYr*r/r-rjrjk���r/rjc��]tRt^otRtRtR#)�InvalidMetaDataExceptionz8Raised when metadata is broken, unavailable or disabled.r*Nrhr*r/r-rnrnos��Br/rnc���\P!V4p.p.pVP4EFwrgV'dVR,V,pMTpVP4V9gVP4V9dVP	V4\V\4'd=VPR4'd&VP	V4VPRR4W6&\V\4'gK�\WxV4p	VPV	PR44VPV	PR44W�V&EK	\V4VR&\V4VR&V#)z�Process all instance metadata cleaning it up for persisting as json.

Strip ci-b64 prefix and catalog any 'base64_encoded_keys' as a list

@return Dict copy of processed metadata.
�/zci-b64:��base64_encoded_keys�sensitive_keys)�copy�deepcopy�items�lower�append�
isinstancer@�
startswith�replace�dict�process_instance_metadata�extend�pop�sorted)
�metadata�key_pathrs�md_copyrr�	sens_keys�key�val�sub_key_path�
return_vals
&&&       r-r}r}ss+���m�m�H�%�G����I��N�N�$����#�c�>�C�/�L��L��I�I�K�>�)��!�!�#�~�5����\�*��c�3���C�N�N�9�$=�$=��&�&�|�4��;�;�y�"�5�G�L��c�4� � �2��>��J�
 �&�&�z�~�~�6K�'L�M����Z�^�^�,<�=�>�%�C�L�'%�(&,�,?�%@�G�!�"� &�y� 1�G����Nr/c�b�VPR.4'gV#\P!V4pVPR4FipVPR4pTpVF@pWe9gK\	WV,\
4'gK)WdR,8wgK8WV,pKB	XV9gKeWV&Kk	V#)z�Redact any sensitive keys from to provided metadata dictionary.

Replace any keys values listed in 'sensitive_keys' with redact_value.
rsrp���)�getrtru�splitryr|)r��redact_valuer�r��
path_parts�obj�paths&&     r-�redact_sensitive_keysr��s����<�<�(�"�-�-����m�m�H�%�G��L�L�!1�2���^�^�C�(�
����D����s�y�$�/�/��r�N�*��i��
��3�;�$��I�3��Nr/c�,a�]tRt^�toV3RltRtVtR#)�	URLParamsc�J<�V^8�dQh/S[;R&S[;R&S[;R&S[;R&#)r=�max_wait_seconds�timeout_seconds�num_retries�sec_between_retries��int)rArBs"�r-rC�URLParams.__annotate__�s5���������������	r/r*N�rOrPrQrR�__annotate_func__rYrZr[s@r-r�r�������r/r�c�,a�]tRt^�toV3RltRtVtR#)�DataSourceHostnamec�B<�V^8�dQh/S[S[,;R&S[;R&#)r=�hostname�
is_default)r	r@�bool)rArBs"�r-rC�DataSourceHostname.__annotate__�s�����s�m�����r/r*Nr�r[s@r-r�r��r�r/r�c�0a�]tRt^�toRtV3RltRtVtR#)�HotplugRetrySettingsz
in secondsc�><�V^8�dQh/S[;R&S[;R&S[;R&#)r=�force_retry�sleep_period�sleep_total)r�r�)rArBs"�r-rC�!HotplugRetrySettings.__annotate__�s,���������	�
��r/r*N)rOrPrQrRrSr�rYrZr[s@r-r�r��s������r/r�c	�a�]tRt^�to]tRtRtRtRt	Rt
Rt]P]P]P]P 3tRBt^
t^t^t]P.]P2]P4]P6]P80/t]P.]P20/tR]3R]3R/3RCRDRERFRGRH3	t Rt!RIt"Rt#]$!R^^4t%Rt&^t'RJV3RlR	llt(V3R
lRlt)Rt*V3R
lRlt+V3RlRlt,Rt-Rt.RKRlt/]0Pb!RRR7V3RlRl4t2RLRlt3V3RlRlt4Rt5RMRlt6Rt7Rt8]9R 4t:]9R!4t;R"t<]9R#4t=R$t>]9R%4t?R&t@R'tAR(tBR)tCR*tDR+tER,tFR-tGR.tHR/tI]9R04tJ]9R14tKR2tLRNR3ltMR4tNV3R5lR6ltOV3R7lR8ltPR9tQR:tR]SROR;l4tT]9R<4tUR=tVR>tWR?tXV3R@ltYRAtZVt[R#)Pr#zen_US.UTF-8�_undefN�ec2_metadata�network_jsonr�Fc�&<�V^8�dQhRS[RS[/#)r=�distro�paths)rr)rArBs"�r-rC�DataSource.__annotate__Os���#�#��#�u�#r/c���WnW nW0nRVn/VnRVnRVnRVnRVnRVn	RVn
\Vn\Vn
\P!VPRVP 3/4VnVP"'g/VnV'g(\$P&!VP4VnR#W@nR#)N�
datasource)�sys_cfgr�r��userdatar��userdata_raw�
vendordata�vendordata2�vendordata_raw�vendordata2_raw�metadata_address�UNSETr�r�r�get_cfg_by_path�dsname�ds_cfgr�UserDataProcessor�ud_proc)rKr�r�r�r�s&&&&&r-�__init__�DataSource.__init__Os��������
�'+��
� ��
�9=���������"���#���/3���+0���!����*�*��L�L�<����5�r�
����{�{�{��D�K��$�6�6�t�z�z�B�D�L�"�Lr/c�$<�V^8�dQhRS[RR/#)r=�ci_pkl_versionr>Nr�)rArBs"�r-rCr�is���#?�#?��#?��#?r/c���RRRRRRR\RRRRR\R	R
RRRRR
\R
^^4/pVP4F$wr4\W4'dK\	WV4K&	\VR4'g\	VRR4\VR4'd)VP
e\
VP
4R#R#R# \d'p\PRT4\4ThRp?ii;i)z(Perform deserialization fixes for Paths.�_crawled_metadataN�_platform_type�_subplatformr��extra_hotplug_udev_rulesr�r��skip_hotplug_detectFr�r��hotplug_retry_settings�check_if_fallback_is_allowedc��R#�Fr*r*r/r-r.�&DataSource._unpickle.<locals>.<lambda>}s��%r/r�z:Unable to unpickle datasource: %s. Ignoring current cache.)r�r�rv�hasattr�setattrr�r@�AttributeError�LOG�debugrg)rKr��expected_attrsr�rI�es&&    r-�	_unpickle�DataSource._unpickleis���
 ���d��D��E�&�����E�!�5��4��t�$�&:�5�!�Q�&G�
��)�.�.�0�J�C��4�%�%���5�)�1��t�;�<�<��D�8�-�H��4��$�$����)B�
?��D�M�M�"�*C�$��"�
?��	�	�/���
6�7�Q�>��

?�s�%C�C1�!C,�,C1c�.�\P!V4#rG)r�obj_namerJs&r-rL�DataSource.__str__�s���"�"�4�(�(r/c� <�V^8�dQhRS[/#r<�r�)rArBs"�r-rCr��s�����4�r/c��R#)z#Check if running on this datasourceTr*rJs&r-�	ds_detect�DataSource.ds_detect����r/c� <�V^8�dQhRS[/#r<r�)rArBs"�r-rCr��s�����D�r/c�(�VPP4\4P48Xd\P	RV4R#VP
P
R.4VP.8Xd\P	RV4R#R#)aOverride if either:
- only a single datasource defined (nothing to fall back to)
- command line argument is used (ci.ds=OpenStack)

Note: get_cmdline() is required for the general case - when ds-identify
does not run, _something_ needs to detect the kernel command line
definition.
z6Kernel command line set to use a single datasource %s.T�datasource_listz2Datasource list set to use a single datasource %s.F)r�rw�
parse_cmdliner�r�r�r�rJs&r-�override_ds_detect�DataSource.override_ds_detect�st���;�;����-�/�"7�"7�"9�9��I�I�H��
��
�\�\�
�
�/��
4����
�
E��I�I�D�d�
��r/c��VP4'dVP4#VP4'd'\P	RV4VP4#\P	RV4R#)z&Overrides runtime datasource detectionzDetected %szDid not detect %sF)r��	_get_datar�r�r�rJs&r-�_check_and_get_data�DataSource._check_and_get_data�s^���"�"�$�$��>�>�#�#�
�^�^�
�
��I�I���
��>�>�#�#��I�I�)�4�0�r/c
��VP4PpVP4pVPpVR,pR/RR.bRVbRVbR\	VP
VPVP4bRVP
bR	VP
bR
VR,^,bRVR,^,bR
VR,^,bRVPbRVP4bRVR,bRVbRVbRVR,^,bRVbRVbRVR,^,RVPRVPRVR,RVR,/C/#)z2Return a dictionary of standardized metadata keys.�sys_info�v1�
_beta_keys�subplatform�availability-zone�availability_zone�cloud_idr$�
cloud_namer��dist�distro_version�distro_release�platform�public_ssh_keys�python_version�python�instance-id�instance_id�kernel_release�uname�local-hostname�local_hostname�machine�region�system_platform�variant)
�get_hostnamer��get_instance_idr��canonical_cloud_idr�r�
platform_type�get_public_ssh_keysr�)rK�
instance_datarrr��sysinfos&&    r-�_get_standardized_metadata�%DataSource._get_standardized_metadata�s����*�*�,�5�5���*�*�,�� �2�2�� �
�+�����}�o��#�%6��$�%6���.��O�O�T�[�[�$�2D�2D��	��d�o�o���d�o�o���'�&�/�!�,��!�'�&�/�!�"4��!�'�&�/�!�"4���D�.�.��"�4�#;�#;�#=��!�'�(�"3���{�� �{�!�"!�'�'�"2�1�"5�#�$!�.�%�&!�.�'�(�7�7�+�A�.��$�+�+��t�/�/�!�7�:�#6��7�9�-�1�
�	
r/c���VP'gR#V'dTpMVPpVF$wr4\W4'gK\WV4K&	V'g
RVnR#R#)z�Reset any cached metadata attributes to datasource defaults.

@param attr_defaults: Optional tuple of (attr, value) pairs to
   set instead of cached_attr_defaults.
NF)�_dirty_cache�cached_attr_defaultsr�r�)rK�
attr_defaults�attr_values�	attributerIs&&   r-�clear_cached_attrs�DataSource.clear_cached_attrs�sZ��� � � ���'�K��3�3�K� +��I��t�'�'����/�!,�� %�D��r/zGetting metadata�always)�log_modec� <�V^8�dQhRS[/#r<r�)rArBs"�r-rCr��s�����$�r/c�h�RVnVP4pV'gV#VP4V#)z�Datasources implement _get_data to setup metadata and userdata_raw.

Minimally, the datasource should return a boolean True on success.
T)rr��persist_instance_data)rK�return_values& r-�get_data�DataSource.get_data�s7��!����/�/�1������"�"�$��r/c��V'd^\PPVPP4'd%\WPP
R44VPeX\\\P!VP44pVPRR4VPRR4RV/pMfRRVP//pVP\8wdVPVR,R&VP \8wdVP VR,R&\"VR,R	&\P!VP$4VR
&RVR
,R	&\P!VR
,4VR&R
VR,R	&\&P(!4VR&VP+VP-V44\.P0!V4p\3\4P6!V4VP8R7pTPPER4pTR,PGRR4p\PPITPPJR4p	\&PL!T	RT2TR24Rp
T	RT2p\PPOT	4'd \PPQT	4p
\&PR!Y�RR7T
'dY�8wd\&PT!T
4\WYuRR7TPPER4p\WT\YT44R# \:d+p\<P?R\AT44Rp?R#Rp?i\Bd+p\<P?R\AT44Rp?R#Rp?ii;i)a Process and write INSTANCE_JSON_FILE with all instance metadata.

Replace any hyphens with underscores in key names for use in template
processing.

:param write_cache: boolean set True to persist obj.pkl when
    instance_link exists.

@return True on successful write, False otherwise.
�obj_pklN�	user-data�vendor-datar7�	meta_datar�r��_doc�
merged_cfgz<DEPRECATED: Use merged_system_cfg. Will be dropped from 24.1�merged_system_cfgzUMerged cloud-init system config from /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/r�)rsz'Error persisting instance-data.json: %sF�instance_data_sensitiver�r��nonezcloud-id�-�
T)�forcei�)�moder)-�osr��lexistsr��
instance_link�	pkl_store�
get_ipath_curr�rr|rtrurr�r�r�r��EXPERIMENTAL_TEXTr�r�system_info�updaterr
�
json_dumpsr}�json�loads�sensitive_metadata_keys�	TypeErrorr��warningr@�UnicodeDecodeError�get_runpathr��join�run_dir�
write_file�exists�realpath�sym_link�del_filerr�)
rK�write_cache�crawled_metadatar�content�processed_datar��json_sensitive_filer��
cloud_id_file�prev_cloud_id_file�new_cloud_id_file�	json_files
&&           r-r� DataSource.persist_instance_datas	���2�7�7�?�?�4�:�:�+C�+C�D�D��d�J�J�4�4�Y�?�@��!�!�-� $��d�m�m�D�$:�$:�;� ��
� � ��d�3�� � ���5�!�#3�4�M�!�K����#?�@�M�� � �E�)�6:�6G�6G�
�d�#�N�3�� � �E�)�6:�6G�6G�
�d�#�N�3�&7�
�d��F�#�&*�m�m�D�L�L�&A�
�l�#�
K�	�l�#��	
�.2�]�]��,�'�.
�
�)�*�
'�	�)�*�6�2�%)�$4�$4�$6�
�j�!����T�<�<�]�K�L�
	�#�.�.�}�=�G�6��
�
�7�#�#�;�;��N�#�j�j�4�4�5N�O�� ��&�*�*�:�v�>�������T�Z�Z�%7�%7��D�
����=�/��8�*�5�(��2��G�!��,�o�Q�x�j�9��
�7�7�>�>�-�(�(�!#���!1�!1�-�!@���
�
�'�d�C��"4�"I��M�M�,�-��&�U�C��J�J�*�*�?�;�	��9�3�N�C�D���1�	��K�K�A�3�q�6�J���!�	��K�K�A�3�q�6�J���	�s+�AM%�%O
�0N�O
�"O
�#O�O
c� <�V^8�dQhRS[/#r<r�)rArBs"�r-rCr�[s���
�
�4�
r/c��\R4h)z@Walk metadata sources, process crawled data and save attributes.zlSubclasses of DataSource must implement _get_data which sets self.metadata, vendordata_raw and userdata_raw.)�NotImplementedErrorrJs&r-r��DataSource._get_data[s��!�
D�
�	
r/c	�f�VPp\VPPRVP44pVPp\^\VPPRVP444pVPp\VPPRVP44pVPp\VPPRVP44p\WW44# \d;\
P!\RTPPR4T4ELi;i \dGTPp\
P!\RTPPR4T4ELi;i \d;\
P!\RTPPR4T4EL(i;i \d;\
P!\RTPPR4T4EL4i;i)	z�Return the Datasource's preferred url_read parameters.

Subclasses may override url_max_wait, url_timeout, url_retries.

@return: A URLParams object with max_wait_seconds, timeout_seconds,
    num_retries.
�max_waitz6Config max_wait '%s' is not an int, using default '%s'�timeoutz5Config timeout '%s' is not an int, using default '%s'�retriesz5Config retries '%s' is not an int, using default '%s'r�zAConfig sec_between_retries '%s' is not an int, using default '%s')�url_max_waitr�r�r��
ValueErrorr�logexcr��url_timeout�max�url_retries�	Exception�url_sec_between_retriesr�)rKrWrXrYr�s&    r-�get_url_params�DataSource.get_url_paramsbs����$�$��	��4�;�;�?�?�:�t�7H�7H�I�J�H��"�"��		��!�S�������D�<L�<L�!M�N�O�G��"�"��	��$�+�+�/�/�)�T�5E�5E�F�G�G�#�:�:��
	�"%������)�4�+G�+G��#����G�I�I��_�	��K�K��H������
�+��	
�	���	��&�&�G��K�K��G������	�*��	
�	���	��K�K��G������	�*��	
�	���	��K�K��&������ 5�6�#�
�	�sK�/D�
9E�/F#�/G+�AE�E�A
F �F �#AG(�'G(�+AH0�/H0c���VPf/VPPVP44VnV'dVP	VP4#VP#rG)r�r��process�get_userdata_raw�
_filter_xdata)rK�apply_filters&&r-�get_userdata�DataSource.get_userdata�sM���=�=� � �L�L�0�0��1F�1F�1H�I�D�M���%�%�d�m�m�4�4��}�}�r/c��VPf/VPPVP44VnVP#rG)r�r�re�get_vendordata_rawrJs&r-�get_vendordata�DataSource.get_vendordata�s5���?�?�"�"�l�l�2�2�4�3J�3J�3L�M�D�O����r/c��VPf/VPPVP44VnVP#rG)r�r�re�get_vendordata2_rawrJs&r-�get_vendordata2�DataSource.get_vendordata2�s:�����#�#�|�|�3�3�D�4L�4L�4N�O�D�����r/c�|�VP'g VPP4VnVP#rG)r�r�rwrJs&r-r
�DataSource.platform_type�s/���"�"�"�"&�+�+�"3�"3�"5�D���"�"�"r/c�h�VP'gVP4VnVP#)a}Return a string representing subplatform details for the datasource.

This should be guidance for where the metadata is sourced.
Examples of this on different clouds:
    ec2:       metadata (http://169.254.169.254)
    openstack: configdrive (/dev/path)
    openstack: metadata (http://169.254.169.254)
    nocloud:   seed-dir (/seed/dir/path)
    lxd:   nocloud (/seed/dir/path)
)r��_get_subplatformrJs&r-r��DataSource.subplatform�s-��� � � � $� 5� 5� 7�D��� � � r/c�R�VP'dRVPR2#\#)z?Subclasses should implement to return a "slug (detail)" string.z
metadata (�))r��METADATA_UNKNOWNrJs&r-rv�DataSource._get_subplatform�s*��� � � ��� 5� 5�6�a�8�8��r/c�^�VP'd
VP#VP'd�VPP\4'd�VPP\4p\	V\
4'd"VP
4VnVP#VP4P
4Vn\PR\\V44VP#VP4P
4VnVP#)z�Return lowercase cloud name as determined by the datasource.

Datasource can determine or define its own cloud product name in
metadata.
z5Ignoring metadata provided key %s: non-string type %s)�_cloud_namer�r��METADATA_CLOUD_NAME_KEYryr@rw�_get_cloud_namer�r��type)rKr�s& r-r��DataSource.cloud_name�s��������#�#�#��=�=�=�T�]�]�.�.�/F�G�G����*�*�+B�C�J��*�c�*�*�#-�#3�#3�#5�� �����$(�#7�#7�#9�#?�#?�#A�� ��	�	�K�+���$������ $�3�3�5�;�;�=�D�����r/c��VP#)z�Return the datasource name as it frequently matches cloud name.

Should be overridden in subclasses which can run on multiple
cloud names, such as DatasourceEc2.
)r�rJs&r-r�DataSource._get_cloud_name�s���{�{�r/c�v�VP'gR#RVP9dVPR,#R#)Nzlaunch-index)r�rJs&r-r�DataSource.launch_index�s,���}�}�}���T�]�]�*��=�=��0�0�r/c��\P!\P!VP44.pTpVFpVP	V4pK	V#rG)r�Filterr�safe_int�apply)rK�processed_ud�filters�new_ud�fs&&   r-rg�DataSource._filter_xdata�sI������
�
�d�.?�.?� @�A�
�����A��W�W�V�_�F���
r/c��VP#rG)r�rJs&r-rf�DataSource.get_userdata_raw�s��� � � r/c��VP#rG)r�rJs&r-rl�DataSource.get_vendordata_raw�s���"�"�"r/c��VP#rG)r�rJs&r-rp�DataSource.get_vendordata2_raws���#�#�#r/c��/#rGr*rJs&r-�get_config_obj�DataSource.get_config_objs���	r/c�J�\VPPR44#)zpublic-keys)�normalize_pubkey_datar�r�rJs&r-r�DataSource.get_public_ssh_keyss��$�T�]�]�%6�%6�}�%E�F�Fr/c��R#)a
Publish the public SSH host keys (found in /etc/ssh/*.pub).

@param hostkeys: List of host key tuples (key_type, key_value),
    where key_type is the first field in the public key file
    (e.g. 'ssh-rsa') and key_value is the key itself
    (e.g. 'AAAAB3NzaC1y...').
Nr*)rK�hostkeyss&&r-�publish_host_keys�DataSource.publish_host_keyss�r/c��RR/pVP4Fgwr4VPV4'gKVFCpRV:V\V4R:2p\PPV4'gK?Vuu#	Ki	R#)�sdz/dev/N)�vd�xvd�vtb)rvrz�lenr1r�rD)rK�
short_name�mappings�nfrom�tlist�nto�cands&&     r-�
_remap_device�DataSource._remap_devicesr���.�/��$�N�N�,�L�E��(�(��/�/����&)�:�c�%�j�l�+C�D���7�7�>�>�$�'�'��K��-�r/c��R#rGr*)rK�_names&&r-�device_name_to_device� DataSource.device_name_to_device's��r/c�x�VPpVPP4pV# \dT#i;i)z<Default locale is en_US.UTF-8, but allow distros to override)�default_localer��
get_localerT)rK�locales& r-r��DataSource.get_locale/sD���$�$��	��[�[�+�+�-�F��
��#�	���
�	�s�*�9�9c���VPPRVPPR44pV'dV#VPPR/4PR4#)r�r��	placement�r�r�)rK�top_level_azs& r-r��DataSource.availability_zone8sY���}�}�(�(�����!2�!2�3F�!G�
������}�}� � ��b�1�5�5�6I�J�Jr/c�8�VPPR4#)rr�rJs&r-r�DataSource.regionAs���}�}� � ��*�*r/c��VP'dRVP9dR#\VPR,4#)rziid-datasource)r�r@rJs&r-r�DataSource.get_instance_idEs-���}�}�}�
�T�]�]� B�#��4�=�=��/�0�0r/c��RpRpTpRpVP'd"VPPR4'g�V'd
\RV4#.p\P!4p	V	R8XdRp\P
!V	4p
V
'd2V
P
R4^8�d\V
4PR4pM�V	'd2V	P
R4^8�d\V	4PR4pM�V	'dW�.pM�WT.pM�VPR,p\P!V4'd_.pV'd\P!V4pV'd\V4PR4pM,RVPRR	4,.pMVPR4p\V4^8�d#V^,p	RPVR
,4pM	V^,p	V'dWd8wd
V	:RV:2p	\W�4#)aGet hostname or fqdn from the datasource. Look it up if desired.

@param fqdn: Boolean, set True to return hostname with domain.
@param resolve_ip: Boolean, set True to attempt to resolve an ipv4
    address provided in local-hostname meta-data.
@param metadata_only: Boolean, set True to avoid looking up hostname
    if meta-data doesn't have local-hostname present.

@return: a DataSourceHostname NamedTuple
    <hostname or qualified hostname>, <is_default> (str, bool).
    is_default is a bool and
    it's true only if hostname is localhost and was
    returned by util.get_hostname() as a default.
    This is used to differentiate with a user-defined
    localhost hostname.
    Optionally return (None, False) when
    metadata_only is True and local-hostname data is not available.
�localdomain�	localhostFrNT�.zip-%sr-:�NN)r�r�r�rr
�get_fqdn_from_hosts�findr@r�r�is_ipv4_address�
gethostbyaddrr{r�rA)rK�fqdn�
resolve_ip�
metadata_only�	defdomain�defhost�domainr��toksr��
hosts_fqdn�lhosts&&&&        r-r
�DataSource.get_hostnameKs���&"�	������
��}�}�}�D�M�M�$5�$5�6F�$G�$G��)�$�
�;�;�
�D��(�(�*�H��;�&�!�
��1�1�(�;�J��j�o�o�c�2�Q�6��:��,�,�S�1���h�m�m�C�0�1�4��8�}�*�*�3�/��� �,���+���M�M�"2�3�E��"�"�5�)�)�����-�-�e�4�D���t�9�?�?�3�/�D�#�e�m�m�C��&=�=�>�D��{�{�3�'���t�9�q�=��A�w�H��X�X�d�2�h�'�F��A�w�H��F�'�"*�F�3�H�!�(�7�7r/c�:�VPPVR7#))�data_source)r��get_package_mirror_inforJs&r-r��"DataSource.get_package_mirror_info�s���{�{�2�2�t�2�D�Dr/c�0<�V^8�dQhRS[S[,/#)r=�source_event_types)rr)rArBs"�r-rCr��s��� � �t�I�� r/c���/pVFipVPP4FHwppW59gKVPV4'g
\4W$&W$,P	V4KJ	Kk	V#rG)�supported_update_eventsrvr��set�add)rKr��supported_events�event�update_scope�
update_eventss&&    r-�get_supported_events�DataSource.get_supported_events�sq��24��'�E��-�-�3�3�5�����)�+�/�/��=�=�9<��(�6�$�2�6�6�u�=�	6�	(� �r/c�6<�V^8�dQhRS[S[,RS[/#)r=r�r>)rrr�)rArBs"�r-rCr��s!���$�$�"&�y�/�$�	
�$r/c� �VPV4pVP4Fmwr4\PRVPRPVUu.uFqUPNK	up44VP
RV,\334Ko	V'd+VP
4VP4pV'dR#\PRTRPVUu.uFqUPNK	up44R#uupiuupi)a�Refresh cached metadata if the datasource supports this event.

The datasource has a list of supported_update_events which
trigger refreshing all cached metadata as well as refreshing the
network configuration.

@param source_event_types: List of EventTypes which may trigger a
    metadata update.

@return True if the datasource did successfully update cached metadata
    due to source_event_type.
z:Update datasource metadata and %s config due to events: %s�, z
_%s_configTz(Datasource %s not updated for events: %sF)	r�rvr�r�rIrArr�r!)rKr�r��scope�matched_eventsr��results&&     r-�update_metadata_if_supported�'DataSource.update_metadata_if_supported�s��� �4�4�5G�H��%5�%;�%;�%=�!�E��I�I�L�����	�	�N�C�N�5�;�;�N�C�D�
�
�#�#�l�U�&:�E�%B�$D�E�&>���#�#�%��]�]�_�F����	�	�6���I�I�0B�C�0B�u�{�{�0B�C�D�	
�
��!D��Ds�D�%Dc��R#r�r*)rKr�s&&r-�check_instance_id�DataSource.check_instance_id�s��r/c��R#)z�check_if_fallback_is_allowed()
Checks if a cached ds is allowed to be restored when no valid ds is
found in local mode by checking instance-id and searching valid data
through ds list.

@return True if a ds allows fallback, False otherwise.
Fr*rJs&r-r��'DataSource.check_if_fallback_is_allowed�s��r/c��Vf\pVf\pVF+pVfK	W29dVu#\PRW14Vu#	V#)Nz%invalid dsmode '%s', using default=%s)�DSMODE_NETWORK�
VALID_DSMODESr�r>)�
candidates�default�valid�	candidates&&& r-�_determine_dsmode�DataSource._determine_dsmode�sV���?�$�G��=�!�E�#�I�� ���!� � ����;�Y����$��r/c��R#rGr*rJs&r-�network_config�DataSource.network_config�r�r/c��R#)asetup(is_new_instance)

This is called before user-data and vendor-data have been processed.

Unless the datasource has set mode to 'local', then networking
per 'fallback' or per 'network_config' will have been written and
brought up the OS at this point.
Nr*)rK�is_new_instances&&r-�setup�DataSource.setup�s��	r/c��R#)a�activate(cfg, is_new_instance)

This is called before the init_modules will be called but after
the user-data and vendor-data have been fully processed.

The cfg is fully up to date config, it contains a merged view of
   system config, datasource config, user config, vendor config.
It should be used rather than the sys_cfg passed to __init__.

is_new_instance is a boolean indicating if this is a new instance.
Nr*)rK�cfgr�s&&&r-�activate�DataSource.activate�s��	r/c��R#)z�
Called when the user issues 'cloud-init clean -c datasource'
command.
Individual data sources should implement their own cleanup handler.
Nr*rJs&r-�clean�DataSource.clean
s��	r/c�<�V^8�dQh/S[S[,;R&S[S[S[S[3,,;R&S[S[R3,;R&S[S[S[S[3,R3,;R&S[S[R3,;R&S[S[,;R&#)r=r}r�.�network_config_sourcesrr<r�)r	r@rrr
r5r)rArBs"�r-rCr��s������#��%��( ��d�C�i� 0�1�8�)�6"�"5�s�":�;��7�p ��c�3�h��� 4�5�
�q�P#�3��8�_�
�Q�H'�s�m�2�Ir/)r}rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r�N)r�N)r�N)r�N)r�N)r�N)
�combined_cloud_configr)r*zsecurity-credentialsr�r%rr�r&zds/vendor_datarG)r*�Tr�)FFF)NN)\rOrPrQrRr��dsmoder�r�r}r�r�r�r5rTrXrVrUrrZr]r_rarr"r�BOOT_NEW_INSTANCE�BOOT�BOOT_LEGACY�HOTPLUGr��default_update_eventsr�rrr<r�r�r�r��_ci_pkl_versionr�r�rLr�r�r�rrr�timedr!rr�rbrirmrq�propertyr
r�rvr�rrrgrfrlrpr�rr�r�r�r�r�rrr
r�r�r�r�r��staticmethodr�r�r�rrr�rYrZr[s@r-r#r#�s�����
�F�"�N��F�"&�K��N�
�L�48��	�$�$��%�%��&�&����	?���L��K��K���@	����'�'��N�N��!�!����	
���	����'�'�
���
���	���	�R����� ��!�
9���L�
0��" ��2�%��A�>��/3���O�#�#�4#?�#?�J)�����,�$
�L&�&���)�H�=��>��$T�l
�
�:J�x��
 �
�#��#�
�
!��
!� �� �� �.������!�#�$��G��� ���K��K��+��+�1�F8�PE� � �$�$�L������*����	���G�r/)�	metaclassc���V'g.#\V\4'dVP4#\V\\34'd\V4#\V\
4'dy.pVP
4F`wr#\V\4'dV.p\V\\34'gK<VFpV'gK
VPV4K 	Kb	V#.#rG)ryr@�
splitlines�listr�r|rvrx)�pubkey_data�keys�_keyname�klist�pkeys&    r-r�r�s�����	��+�s�#�#��%�%�'�'��+��c�{�+�+��K� � ��+��&�&���*�0�0�2�O�H��%��%�%�����%�$���-�-�!�D��t����D�)�	"� 3���
�Ir/c�F�V^8�dQhR\\\3,/#r<)r
r#r@)rAs"r-rCrC0s��+�+�
�:�s�?��+r/c	�J�\WCV4pVUu.uFp\P!V4NK	p	p\V9dRMRp
\PRW�4\
W�4F�wr�\P!RVPRR4,RV
:RV:2RV
:R	V:2VR
7p
T
;_uu_4\PRV4V!WV4pVP\P.4'd4RV
:RV:2V
n
V\P!V43uuR
R
R
4u#R
R
R
4K�	RRP#V	4,p\%V4huupi +'giEK;i \d"\P !\RT4EK?i;i)�networkrz#Searching for %s data source in: %sz	search-%sr#rqzsearching for z data from zno z data found from )�name�description�message�parentz%Seeing if we can get any data from %szfound NzGetting data from %s failedz4Did not find any data source, searched classes: (%s)r�)�list_sourcesrr��DEP_NETWORKr�r��zipr�ReportEventStackr{r�rrr"r`rr\rArj)r�r�r��ds_deps�cfg_list�pkg_list�reporter�ds_listr��ds_namesr0r �cls�myrep�s�msgs&&&&&&&         r-�find_sourcer20sl���8�h�7�G�07�8��1�
�#�#�A�&��H�8�#�w�.�9�G�D��I�I�3�T�D���+�	���'�'��t�|�|�L�"�=�=�;?��F�26��=��	
��
	A����	�	�A�3�G����/���1�1��0�0�1���@D�T�$J�E�M��z�2�2�3�7�8������,�&A�4�9�9��D��C�&�c�
*�*��59������	A��K�K��:�C�@�@�	A�s<�E�)
E6�3A,E!�
E6�-E6�!E3�,E6�3E6�6'F"�!F"c��.p\PRVVV4VF�p\P!V4p\P!WRR.4wrgV'g\PRV4VFIp\P!V4p	\V	R4p
V
!V4pV'gK7VPV4K�	K�	V#)z�Return a list of classes that have the same depends as 'depends'
iterate through cfg_list, loading "DataSource*" modules
and calling their "get_datasource_list".
Return an ordered list of classes that match (if any)
zLLooking for data source in: %s, via packages %s that matches dependencies %s�get_datasource_listzDCould not import %s. Does the DataSource exist and is it importable?)	r�r�r�"match_case_insensitive_module_name�find_module�error�
import_module�getattrr~)r)�dependsr*�src_listr7�ds_name�m_locs�_looked_locs�m_loc�mod�lister�matchess&&&         r-r$r$Qs����H��I�I�	8��������=�=�b�A��'�3�3�� 5�6� 
�����I�I�$��
�
�E��(�(��/�C��S�"7�8�F��W�o�G��w�����(��
��$�Or/c�0�V^8�dQhR\R\/#)r=�fieldr>)r@r�)rAs"r-rCrCus��4�4��4�	�4r/c��V'gR#\P!V4pV'gR#VP4VP48H#r�)r�
read_dmi_datarw)rrD�	dmi_values&& r-�instance_id_matches_system_uuidrHus;��
���!�!�%�(�I�������)�/�/�"3�3�3r/c�$�V'g\pV'g\pV\8XdV\8wdV#V#\P4F4wr4VwrVVPV4'gK"V!V4'gK2Vu#	V\8wdV#V#)z@Lookup the canonical cloud-id for a given cloud_name and region.)rz�CLOUD_ID_REGION_PREFIX_MAPrvrz)r�rr��prefix�
cloud_id_testr��valid_clouds&&&    r-rr�s����%�
��!��
�!�!��)�)�����!;�!A�!A�!C���"/������V�$�$��Z�)@�)@��O�"D��%�%����Or/c�Z�V'gR#\V\4'dV#\V\4'd\P!V4#\V\
4'd.VRJd\
VPR4RR7#\R4h\R\V4,4h)a,data: a loaded object (strings, arrays, dicts).
return something suitable for cloudinit vendordata_raw.

if data is:
   None: return None
   string: return string
   list: return data
         the list is then processed in UserDataProcessor
   dict: return convert_vendordata(data.get('cloud-init'))
NTz
cloud-initF)�recursez'vendordata['cloud-init'] cannot be dictz$Unknown data type for vendordata: %s)
ryr@rrtrur|�convert_vendordatar�r[r�)�datarOs&&r-rPrP�s������$�������$�����}�}�T�"�"��$�����d�?�%�d�h�h�|�&<�e�L�L��B�C�C�
�;�d�4�j�H�
I�Ir/c��]tRtRtRtR#)�BrokenMetadatai�r*Nrkr*r/r-rSrS�rlr/rSc�|�.p\V4pVF(wrEV\V48XgKVPV4K*	V#rG)r�rx)r:r,�ret_list�depsetr.�depss&&    r-�list_from_dependsrX�s;���H�
��\�F��	���S��Y���O�O�C� ���Or/c�<�V^8�dQhR\R\R\/#)r=r��fnamer>)r#r@r�)rAs"r-rCrC�s!����:��c��d�r/c� �\P!V4p\P!YRRR7R# \d!\P!\
RT4R#i;i \d!\P!\
RT4R#i;i)zSUse pickle to serialize Datasource to a file as a cache.

:return: True on success
zFailed pickling datasource %sF�wb�)�omoder0z Failed pickling datasource to %sT)�pickle�dumpsr`rr\r�rC)r�rZ�pk_contentss&& r-r4r4�sx��
��l�l�3�'�������$�U�C��������C�8�#�>����
�����C�;�U�C���s �4�A"�'A�A�"'B
�B
c�F�V^8�dQhR\R\\,/#)r=rZr>)r@r	r#)rAs"r-rCrC�s����C��H�Z�0�r/c��Rp\P!V4pV'gR#\P!V4# \dFp\PPT4'd\PRY4Rp?LlRp?ii;i \dR#\d!\P!\RT4R#i;i)zBUse pickle to deserialize a instance Datasource from a cache file.Nzfailed loading pickle in %s: %sz#Failed loading pickled blob from %s)r�load_binary_filer`r1r��isfiler�r>r_r;rgr\)rZ�pickle_contentsr�s&  r-�pkl_loadrg�s����O�E��/�/��6������|�|�O�,�,���E�
�7�7�>�>�%� � ��K�K�9�5�D���E��+��������C�>��F���s2�;�B�B�;B�B�C�C�%C�Cc�$�V^8�dQhR\/#r<r?)rAs"r-rCrC�s��4�4�s�4r/c�>�\\P!44#)z}Check if command line argument for this datasource was passed
Passing by command line overrides runtime datasource detection
)�parse_cmdline_or_dmir�get_cmdliner*r/r-r�r��s�� �� 0� 0� 2�3�3r/c�0�V^8�dQhR\R\/#)r=�inputr>r?)rAs"r-rCrC�s�������r/c���\P!RV4p\P!RV4p\P!RV4pT;'g
T;'gTpT;'gTpV'dCVP^4P4p\P
!RVRV2RRVR2R7V'd)VP^4'dVP^4#R	#)
z(?:^|\s)ds=([^\s;]+)z(?:^|\s)ci\.ds=([^\s;]+)z (?:^|\s)ci\.datasource=([^\s;]+)z8Defining the datasource on the command line using ci.ds=z or ci.datasource=z23.2zUse ds=z instead)�
deprecated�deprecated_version�
extra_messagerq)�re�search�group�stripr�	deprecate)rm�
ds_parse_0�
ds_parse_1�
ds_parse_2r7ror�s&      r-rjrj�s������2�E�:�J����6��>�J����>��F�J�	�	/�	/�z�	/�	/�Z�B��)�)�z�J���!�!�!�$�*�*�,��������!!�!'��*� &�#�F�8�8�4�	
�
�b�h�h�q�k�k��x�x��{��
r/)rqr*)zsystem-uuidr	)W�abcrtr:�loggingr1r_rr�enumrr�typingrrrrr	r
rr�	cloudinitr
rrrrrrrr�cloudinit.atomic_helperr�cloudinit.distrosr�cloudinit.eventrr�cloudinit.filtersr�cloudinit.helpersr�cloudinit.persistencer�cloudinit.reportingr�DSMODE_DISABLED�DSMODE_LOCALr��DSMODE_PASSr��DEP_FILESYSTEMr%�	DS_PREFIXr6�REDACT_SENSITIVE_VALUEr~r�rz�	getLoggerrOr�rJr5r]r`rgrjrnr}r�r�r�r��ABCMetar#r�r2r$rHrrP�IOErrorrSrXr4rgr�rjr*r/r-�<module>r�s�������	�
�	��L�L�L�
�
�
�/�$�1�*�#�6�&��������� �,��?�
������	�<��6��'������
����!��

�K�-�.�
�	�/�0��m�3�
4����
�$�
��
� �t��P�i�P�	�)�	�C�y�C� �F2H��:�
�����
�:��I
�%����I
�X�:+�B!�H4��&J�0	�W�	���$�*4�r/

Youez - 2016 - github.com/yon3zu
LinuXploit