__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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[hLT���SrSSKrSSKrSSKrSSKrSSKrSSKJrJrJ	r	J
r
JrJr SSK
JrJrJrJrJr SSKJr SSKJrJrJrJr SSKJr \R8"\5rSS	0rS
r Sr!Sr"\!S
-r#\"S
-r$SS0r%Sr&"SS\
5r'"SS\RP5r)S\SS4Sjr*"SS\RV5r,"SS\,5r-S\.4Sjr/S\\.4Sjr0S\14Sjr2S \.S\34S!jr4S \.S\\\.\.44S"jr5S \.S\.4S#jr6S	\,Rn\,Rp\#/S$.S%\1S&\	\.S\\'4S'jjr9\,\Rt44\-\Rt\Rv44/r<S(r=\S):Xa)S*r>\?"\R�"\9"\$\#/S+9\2"5S,.55 gg)-a3Datasource for Oracle (OCI/Oracle Cloud Infrastructure)

Notes:
 * This datasource does not support OCI Classic. OCI Classic provides an EC2
   lookalike metadata service.
 * The UUID provided in DMI data is not the same as the meta-data provided
   instance-id, but has an equivalent lifespan.
 * We do need to support upgrade from an instance that cloud-init
   identified as OpenStack.
 * Bare metal instances use iSCSI root, virtual machine instances do not.
 * Both bare metal and virtual machine instances provide a chassis-asset-tag of
   OracleCloud.com.
�N)�Any�Dict�List�
NamedTuple�Optional�Tuple)�
atomic_helper�dmi�net�sources�util)�
NetworkConfig)�cmdline�	ephemeral�get_interfaces_by_mac�is_netfail_master)�wait_for_url�configure_secondary_nicsFzOracleCloud.comz&http://169.254.169.254/opc/v{version}/z+http://[fd00:c1::a9fe:a9fe]/opc/v{version}/z{path}/�
Authorizationz
Bearer Oraclei(#c�X�\rSrSr%\\S'\\\4\S'\	\\\4\S'\\S'Sr
g)�ReadOpcMetadataResponse�4�version�
instance_data�
vnics_data�
imds_url_used�N)�__name__�
__module__�__qualname__�__firstlineno__�int�__annotations__r�strrr�__static_attributes__r��D/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceOracle.pyrr4s.��
�L���S��>�!���c�3�h��(�(��r&rc�&�\rSrSrSrS\4SjrSrg)�KlibcOracleNetworkConfigSource�;z�Override super class to lower the applicability conditions.

If any `/run/net-*.cfg` files exist, then it is applicable. Even if
`/run/initramfs/open-iscsi.interface` does not exist.
�returnc�,�[UR5$)zOverride is_applicable)�bool�_files��selfs r'�
is_applicable�,KlibcOracleNetworkConfigSource.is_applicableBs���D�K�K� � r&rN)rrr r!�__doc__r-r1r%rr&r'r)r);s���!�t�!r&r)�network_configr+c��SU;agUSS;a[RSUS5 g[5nUSS:XamUSVs/sH
nSU;dMUPM snHJnUSS:XdMS	U;dMUS	nURU5nU(dM5[	U5(dMGUS		ML gUSS
:Xa�URS05R5HsupcSU;dM
URS05RS
5nU(dM7URU5nU(dMQ[	U5(dMcUSS
	US	XSSS'Mu ggs snf)a(
Search network config physical interfaces to see if any of them are
a netfailover master.  If found, we prevent matching by MAC as the other
failover devices have the same MAC but need to be ignored.

Note: we rely on cloudinit.net changes which prevent netfailover devices
from being present in the provided network config.  For more details about
netfailover devices, refer to cloudinit.net module.

:param network_config
   A v1 or v2 network config dict with the primary NIC, and possibly
   secondary nic configured.  This dict will be mutated.

rN)��z+Ignoring unknown network config version: %sr6�config�type�physical�mac_addressr7�	ethernets�match�
macaddresszset-name�name)�LOG�debugr�getr�items)r4�mac_to_name�c�cfg�mac�cur_name�_�macaddrs        r'�_ensure_netfailover_saferKGs[�� ��&���i� ��.��	�	�9��9�%�	
�	�'�)�K��i� �A�%�-�h�7�G�7�!�6�Q�;�A�7�G�C��6�{�j�(� �C�'��m�,�C�*���s�3�H�#� �*�8�4�4��
�.�H�
�	�	"�a�	'�$�(�(��b�9�?�?�A�F�A��#�~��'�'�'�2�.�2�2�<�@���7�*���w�7�H�#� �*�8�4�4���L��6��
�O�/7�G��V�,�B�
(��Hs�
E
�E
c�^�\rSrSr%SrSr\RR\RR\RR\RR4r\
\RS4\S'SrSrSrU4S	jrS
\SS4U4SjjrS\4S
jr\S\4Sj5rSrS\4SjrSrS\4SjrS\4Sjr\S5r SS\4Sjjr!Sr"U=r#$)�DataSourceOracle�{�OracleN.�network_config_sourcesT��c�`>�[[U]
"U/UQ70UD6 SUl[R
"[R"USUR/05[/5Ul	[5Ul/SS.UlUR5nURUlUR Ulg)N�
datasourcer6�r8r)�superrM�__init__�_vnics_datar
�
mergemanydict�get_cfg_by_path�dsname�BUILTIN_DS_CONFIG�ds_cfgr)�_network_config_source�_network_config�get_url_params�max_wait_seconds�url_max_wait�timeout_seconds�url_timeout)r0�sys_cfg�args�kwargs�
url_params�	__class__s     �r'rW�DataSourceOracle.__init__�s����
���.�w�H��H��H�����(�(��$�$�W�|�T�[�[�.I�2�N�!�
�
���'E�&F��#�02�q�%A����(�(�*�
�&�7�7���%�5�5��r&�ci_pkl_versionr+c��>�[TU]U5 [US5(d
[USS5 [US5(d[US[	55 [US5(d/SS.Ulgg)NrXr^r_r6rU)rV�	_unpickle�hasattr�setattrr)r_)r0rkris  �r'rm�DataSourceOracle._unpickle�sm���
���.�)��t�]�+�+��D�-��.��t�5�6�6���(�.�0�
�
�t�.�/�/�.0�Q�#?�D� �0r&c�L�[URRS/55$)Nr8)r-r_rBr/s r'�_has_network_config�$DataSourceOracle._has_network_config�s ���D�(�(�,�,�X�r�:�;�;r&c��[5$)z@Check platform environment to report if this datasource may run.)�_is_platform_viablerr&r'�	ds_detect�DataSourceOracle.ds_detect�s
��#�$�$r&c	��[5Ul[RSSS9[S.S[RSSS90[
RSSS9[S.S[
RSSS904nUR(a8[R"5n[R"URUSSUS9nO[R"5nUR5(+nURR!S	["S	5nU [%U=(d UUR&UR([
[/S
9nSSS5 W(dg[+UR,S9UlUR0=oplUR4UlUS
USSUSUSS.UlSU;aWUSR!S5nU(a[:R<"U5UlUSR!S5UR8S'g!,(df   N�=f)Nr7�instance�r�path)�url�headersr|r6T)�distro�	interface�ipv6�ipv4�connectivity_urls_datar��fetch_vnics_data�max_wait�timeout�metadata_patternsF�r|�	ociAdName�idr�hostname�displayName)zavailability-zonezinstance-idzlaunch-indexzlocal-hostnamer?�metadata�	user_data�ssh_authorized_keys�public_keys) �_read_system_uuid�system_uuid�IPV4_METADATA_PATTERN�format�
V2_HEADERS�IPV6_METADATA_PATTERN�perform_dhcp_setupr�find_fallback_nicr�EphemeralIPNetworkr~r
�nullcontext�_is_iscsi_rootr]rBr\�read_opc_metadatarbrd� _get_versioned_metadata_base_urlr�metadata_addressr�_crawled_metadatarrXr��base64�	b64decode�userdata_raw)	r0r��nic_name�network_context�fetch_primary_nic�fetch_secondary_nics�fetched_metadata�datar�s	         r'�	_get_data�DataSourceOracle._get_data�s,��,�.���-�3�3��J�4��&�	
��,�3�3��J�4��
�-�3�3��J�4��&�	
��,�3�3��J�4��
�%"
��2�"�"��,�,�.�H�'�:�:��{�{�"���'=��O�#�.�.�0�O� $� 3� 3� 5�5��#�{�{���&��8�9� 
��
�0�!2�!J�6J��*�*��(�(�)�)�#�	 ��� ��!A� �.�.�!
���)9�(F�(F�F��%�+�6�6���"&�k�!2���:��"�:�.���'�
��
�����Z�(�,�,�[�9�I��$*�$4�$4�Y�$?��!�+/�
�+;�+?�+?�%�,�D�M�M�-�(��M�_�s�4G>�>
Hc�B�[R"UR5$)z�quickly check (local only) if self.instance_id is still valid

On Oracle, the dmi-provided system uuid differs from the instance-id
but has the same life-span.)r�instance_id_matches_system_uuidr�)r0res  r'�check_instance_id�"DataSourceOracle.check_instance_id	s��
�6�6�t�7G�7G�H�Hr&c�`�[R"URRS55$)Nr�)r�normalize_pubkey_datar�rBr/s r'�get_public_ssh_keys�$DataSourceOracle.get_public_ssh_keyss"���,�,�T�]�]�->�->�}�-M�N�Nr&c�6�URR5$)z)Return whether we are on a iscsi machine.)r^r1r/s r'r��DataSourceOracle._is_iscsi_roots���*�*�8�8�:�:r&c�6�URR5$�N)r^�
render_configr/s r'�_get_iscsi_config�"DataSourceOracle._get_iscsi_configs���*�*�8�8�:�:r&c��UR5(aUR$SnUR5(aUR5UlUR5(d[RS5 SnURRS[S5nU(dU(aURU5 [UR5 UR$![a [R"[S5 NHf=f)z�Network config is read from initramfs provided files

Priority for primary network_config selection:
- iscsi
- imds

If none is present, then we fall back to fallback configuration.
FzLCould not obtain network configuration from initramfs. Falling back to IMDS.Trz+Failed to parse IMDS network configuration!)rrr_r�r�r@�warningr]rBr\�!_add_network_config_from_opc_imds�	Exceptionr
�logexcrK)r0�set_primary�
set_secondarys   r'r4�DataSourceOracle.network_configs����#�#�%�%��'�'�'������ � �#'�#9�#9�#;�D� ��'�'�)�)��K�K�(�
��K������&��8�9�
�
��-�
��6�6�{�C�	!��!5�!5�6��#�#�#���
�����A��
�s�,C�%D�Dr�c��URc[RS5 gU(d)SURS;a[RS5 g[5nU(aUROURSSn[	U5GHwupEU=(a US:HnUSR5nUR
SS	5=(a UR
S
S	5(+nXr;a[RSU5 MtX'n	U(a[R"USS5n
O[R"US
5n
URSS:Xa�U(aU(aSS0/nO�SS0/nO}/nUR
S
5(a&URSUS
SU
R3S.5 UR
S5(a)URSUSSSU
R3S.5 U	SU[US.nURSRU5 GM�URSS:XdGM�[SU0S.nX�RSU	'U=(a UUS'U=(a U(+US'U(d�/US'UR
S
5(a&USRUS
SU
R35 UR
S5(a)USRUSSSU
R35 X�RSU	'GMz g)adGenerate primary and/or secondary NIC config from IMDS and merge it.

It will mutate the network config to include the secondary VNICs.

:param set_primary: If True set primary interface.
:raises:
Exceptions are not handled within this function.  Likely
    exceptions are KeyError/IndexError
    (if the IMDS returns valid JSON with unexpected contents).
Nz#NIC data is UNSET but should not be�nicIndexrz\VNIC metadata indicates this is a bare metal machine; skipping secondary VNIC configuration.r6�macAddr�ipv6SubnetCidrBlockF�	privateIpz)Interface with MAC %s not found; skipping�
ipv6Addresses�subnetCidrBlockrr9�dhcp6�dhcp�static�/)r9�addressr:)r?r9r;�mtu�subnetsr8r7r>)r�r=r<�dhcp4�	addresses)
rXr@r�r�	enumerate�lowerrB�	ipaddress�
ip_networkr_�append�	prefixlen�MTU)
r0r��interfaces_by_macr�index�	vnic_dict�
is_primaryr;�is_ipv6_onlyr?�networkr��interface_configs
             r'r��2DataSourceOracle._add_network_config_from_opc_imdsHs2�����#��K�K�=�>���
�d�.>�.>�q�.A� A�
�K�K�9�
�
�1�3��)4�T�%�%�$�:J�:J�1�2�:N�
�!*�*� 5��E�$�3��!��J�#�I�.�4�4�6�K�$�=�=�%�u��8��m�m�K��7�7�
��3����?����$�1�D��#�.�.��o�.�q�1���$�.�.�y�9J�/K�L���#�#�I�.�!�3��#�$*�G�#4�"5��$*�F�#3�"4�� �G� �}�}�[�1�1����(0�'0��'=�&>�a�'.�'8�'8�&9�%;���!�}�}�_�5�5����(0�'0��'A�!�'D�&E�Q�'.�'8�'8�&9�%;���!�&�#.��&�$� ��$�$�X�.�5�5�6F�G��%�%�i�0�A�5��*�K�8�$� �;K�$�$�[�1�$�7�,6�,G�<� ��)�,6�,K�|�;K� ��)�!�46�$�[�1� �}�}�[�1�1�(��5�<�<�(��5�6�a��8I�8I�7J�K��!�}�}�_�5�5�(��5�<�<�(��9�!�<�=�Q�&�0�0�1�3��;K�$�$�[�1�$�7�]!6r&)r�r_r^rXr]r�r�r�rbrdr�)F)$rrr r!r[r�r�NetworkConfigSource�CMD_LINE�
SYSTEM_CFG�DS�	INITRAMFSrPrr#r�rbrdrWr"rmr-rr�staticmethodrvr�r�r�r��dictr��propertyr4r�r%�
__classcell__)ris@r'rMrM{s���
�F��K��#�#�,�,��#�#�.�.��#�#�&�&��#�#�-�-�	G��E�'�"=�"=�s�"B�C�����L��K�6�"@��@��@�<�T�<��%�t�%��%�T�lI�D�I�O�;��;�;�4�;��+$��+$�ZqK�T�qK�qKr&rMc��\rSrSrSrSrg)�DataSourceOracleNeti�FrN)rrr r!r�r%rr&r'r�r��s���r&r�r�c�`�U(dgUR[RS5S5$)NF�opcr)�
startswith�IPV4_METADATA_ROOT�split)r�s r'�_is_ipv4_metadata_urlr��s*�����&�&�'9�'?�'?��'F�q�'I�J�Jr&c�X�[R"S5nUcS$UR5$)Nzsystem-uuid)r
�
read_dmi_datar�)�sys_uuids r'r�r��s)��� � ��/�H��#�4�9����)9�9r&c�@�[R"S5nU[:H$)Nzchassis-asset-tag)r
r��CHASSIS_ASSET_TAG)�	asset_tags r'ruru�s���!�!�"5�6�I��)�)�)r&r|c��SU;aS$S$)Nz/opc/v2/r7r6rr�s r'�_url_versionr��s���c�!�1�(�q�(r&c�0�[U5S:Xa[$S$)Nr7)r�r�r�s r'�_headers_cbr��s��%�c�*�a�/�:�9�T�9r&c��U(dU$SU;aURS5SS-$SU;aURS5SS-$[SU-5e)zI
Remove everything following the version number in the metadata address.
�v2rzv2/�v1zv1/zInvalid metadata address: )r��
ValueErrorr�s r'r�r��s[����
��s�{��y�y���q�!�E�)�)�	
����y�y���q�!�E�)�)��5��;�<�<r&r�r�r�c
�$�SVVs/sHnUHnURUSS9PM M nnn[RSU5 [R"5n[UUU[SSS9up�U(d&[RSS	RU55 g
[RSU5 [R"U	RS55n
[U5nS
nU(a�[URSS
5/U[R"5U-
-
U[SSS9up�U
(a<[R"URS55n[RSU
5 O[RS5 [UU
UU5$s snnf)a�
Fetch metadata from the /opc/ routes from the IMDS.

Returns:
    Optional[ReadOpcMetadataResponse]: If fetching metadata fails, None.
        If fetching metadata succeeds, a namedtuple containing:
        - The metadata version as an integer
        - The JSON-decoded value of the instance data from the IMDS
        - The JSON-decoded value of the vnics data from the IMDS if
            `fetch_vnics_data` is True, else None. Alternatively,
            None if fetching metadata failed
        - The url that was used to fetch the metadata.
            This allows for later determining if v1 or v2 endppoint was
            used and whether the IMDS was reached via IPv4 or IPv6.
)r7r6ryrzz*Attempting to fetch IMDS metadata from: %sg�������?T)�urlsr�r��
headers_cb�
sleep_time�connect_synchronouslyz-Failed to fetch IMDS metadata from any of: %sz, Nz7Successfully fetched instance metadata from IMDS at: %szutf-8�vnicsz4Successfully fetched vnics metadata from IMDS at: %sz+Failed to fetch IMDS network configuration!)r�r@rA�time�	monotonicrr�r��join�json�loads�decoder��replacer)r�r�r�r�r�metadata_patternr�
start_time�url_that_worked�instance_responser�metadata_versionr�	vnics_url�vnics_responses               r'r�r��s���0���G� 1��	����j��A� 1�	B��	���I�I�:�D�A����!�J�)5�
�����"�
*�&�O�����;��I�I�d�O�	
���	�	�E��	
��J�J�0�7�7��@�A�M�$�O�4���J��%1�!�)�)�*�g�>�?�����!1�J�!>�?��"��"&�
%
�!�	�����N�$9�$9�'�$B�C�J��I�I�F��
�

�K�K�E�F�"�����	���ks�$Fc�8�[R"U[5$r�)r�list_from_depends�datasources)�dependss r'�get_datasource_listrGs���$�$�W�k�:�:r&�__main__z�
        Query Oracle Cloud metadata and emit a JSON object with two keys:
        `read_opc_metadata` and `_is_platform_viable`.  The values of each are
        the return values of the corresponding functions defined in
        DataSourceOracle.py.)r�)r�ru)Ar3r�r�r	�loggingr�typingrrrrrr�	cloudinitr	r
rrr
�cloudinit.distros.networkingr�
cloudinit.netrrrr�cloudinit.url_helperr�	getLoggerrr@r\r�r��IPV6_METADATA_ROOTr�r�r�r�r�KlibcNetworkConfigSourcer)rK�
DataSourcerMr�r$r�r�r-rur"r�r�r�rbrdr��DEP_FILESYSTEM�DEP_NETWORKrr�description�print�
json_dumpsrr&r'�<module>r)s0��������?�?�<�<�6���.�
����!������&��=��B��*�Y�6��*�Y�6����
/�
����j��	!�W�%E�%E�	!�18�]�18�t�18�h~K�w�)�)�~K�B
�*��K�C�K�:�8�C�=�:�
*�T�*�
)�c�)�c�)�:�S�:�X�d�3��8�n�5�:�=�#�=�#�=� #�
�
*�
*��(�(�$9�#:�P��P�
�C�y�P��%�&�
P�j��.�.�0�1���"�"����	
��	��;��z�� �K�
�� � �%6�.�0E�F�&�
(;�'<�

�		
��r&

Filemanager

Name Type Size Permission Actions
DataSourceAkamai.cpython-313.pyc File 12.33 KB 0644
DataSourceAliYun.cpython-313.pyc File 18.33 KB 0644
DataSourceAltCloud.cpython-313.pyc File 9.85 KB 0644
DataSourceAzure.cpython-313.pyc File 79.75 KB 0644
DataSourceBigstep.cpython-313.pyc File 2.86 KB 0644
DataSourceCloudCIX.cpython-313.pyc File 7.22 KB 0644
DataSourceCloudSigma.cpython-313.pyc File 5.18 KB 0644
DataSourceCloudStack.cpython-313.pyc File 13.11 KB 0644
DataSourceConfigDrive.cpython-313.pyc File 14.2 KB 0644
DataSourceDigitalOcean.cpython-313.pyc File 6.2 KB 0644
DataSourceEc2.cpython-313.pyc File 43.31 KB 0644
DataSourceExoscale.cpython-313.pyc File 8.9 KB 0644
DataSourceGCE.cpython-313.pyc File 16.12 KB 0644
DataSourceHetzner.cpython-313.pyc File 6.46 KB 0644
DataSourceIBMCloud.cpython-313.pyc File 18.43 KB 0644
DataSourceLXD.cpython-313.pyc File 20.3 KB 0644
DataSourceMAAS.cpython-313.pyc File 18.29 KB 0644
DataSourceNWCS.cpython-313.pyc File 6.76 KB 0644
DataSourceNoCloud.cpython-313.pyc File 17.26 KB 0644
DataSourceNone.cpython-313.pyc File 1.88 KB 0644
DataSourceOVF.cpython-313.pyc File 15.34 KB 0644
DataSourceOpenNebula.cpython-313.pyc File 18.96 KB 0644
DataSourceOpenStack.cpython-313.pyc File 13.1 KB 0644
DataSourceOracle.cpython-313.pyc File 21.77 KB 0644
DataSourceRbxCloud.cpython-313.pyc File 10.25 KB 0644
DataSourceScaleway.cpython-313.pyc File 17.07 KB 0644
DataSourceSmartOS.cpython-313.pyc File 38.32 KB 0644
DataSourceUpCloud.cpython-313.pyc File 7.11 KB 0644
DataSourceVMware.cpython-313.pyc File 35.8 KB 0644
DataSourceVultr.cpython-313.pyc File 5.79 KB 0644
DataSourceWSL.cpython-313.pyc File 15.48 KB 0644
__init__.cpython-313.pyc File 47.24 KB 0644
Filemanager