__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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����%SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
JrJrJ
r
JrJr SSKJrJr \R&"\5rSSSSSS	S
SSS
SSSS.
rSSSS.rSrSrSrS\/r/SQrSrSrSr\\\\/SSS 0S!.r SS"SSS#.0SS$SS%./S&.r!S'r"S(r#"S)S*\
RH5r%"S+S,\&5r'"S-S.\'5r("S/S05r)"S1S2\)5r*"S3S4\)5r+"S5S6\+5r,S\\\S4S7jr-S8r.SGS9jr/SHS:jr0SIS;jr1\%\
Rd44/r3S<r4\S=:Xa�SSK5r5\-"5r6\6c\7"S>5 \5Rp"S?5 \9"\5Rt5S?:Xa2\;"\Ry55\;"\Ry55-S@/-r<O\5RtS?Sr<SAr=0r>\?\@SB'\<HrA\="\6\A\>SC9 M
 \7"\R�"\>S?SDSESF95 gg)J�N)�
atomic_helper�dmi�sources�subp�util)�
EventScope�	EventType)zsdc:uuidT)�hostnameT)�root_authorized_keysT)�user-scriptF)�	user-dataF)zcloud-init:user-dataF)�iptables_disableT)�
motd_sys_infoT)�sdc:datacenter_nameT)zsdc:vendor-dataF)zsdc:operator-scriptF)zsdc:hostnameT)zsdc:dns_domainT)
�instance-id�local-hostnamezpublic-keysr�legacy-user-datar
rr�availability_zone�vendor-data�operator-scriptr
�
dns_domainzsdc:nicsz
sdc:resolversz
sdc:routes)�network-data�dns_servers�routeszlx-brand�kvm�SmartOS�
datasource)rrrrzsdc:uuiduser-datarz"/native/.zonecontrol/metadata.sockz
/dev/ttyS1�<F�
ephemeral0z/dev/vdb)�
serial_device�serial_timeout�metadata_sockfile�no_base64_decode�base64_keys�
base64_all�disk_aliases�mbr)�
table_type�layout�	overwrite�ext4)�label�
filesystem�device)�
disk_setup�fs_setupaU#cloud-boothook
#!/bin/sh
fname="%(per_boot_d)s/01_smartos_vendor_data.sh"
mkdir -p "${fname%%/*}"
cat > "$fname" <<"END_SCRIPT"
#!/bin/sh
##
# This file is written as part of the default vendor data for SmartOS.
# The SmartOS datasource writes the listed file from the listed metadata key
#   sdc:operator-script -> %(operator_script)s
#   user-script -> %(user_script)s
#
# You can view content with 'mdata-get <key>'
#
for script in "%(operator_script)s" "%(user_script)s"; do
    [ -x "$script" ] || continue
    echo "executing '$script'" 1>&2
    "$script"
done
END_SCRIPT
chmod +x "$fname"
z/var/dbc���\rSrSrSr\Rr\Rr\	R\R\R\R10rSrSrSrSrSrSrS	rS
rSr\S5rS
rg)�DataSourceSmartOS��Joyentc��[RRXX#5 [R"UR
[R"U[05[/5Ul0Ul	SUl
SUlSUl[RRUR R#S55UlUR'5 g)N�scripts)r�
DataSource�__init__r�
mergemanydict�ds_cfg�get_cfg_by_path�DS_CFG_PATH�BUILTIN_DS_CONFIG�metadata�network_data�_network_config�routes_data�os�path�join�paths�	get_cpath�
script_base_d�_init)�self�sys_cfg�distrorEs    �E/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceSmartOS.pyr8�DataSourceSmartOS.__init__�s������#�#�D�6�A��(�(�����$�$�W�k�2�>�!�
�
�����
� ���#�������W�W�\�\�$�*�*�*>�*>�y�*I�J����
�
��c�h�[RRU5nU<SUR<S3$)Nz	 [client=�])rr7�__str__�	md_client)rI�roots  rLrQ�DataSourceSmartOS.__str__�s'���!�!�)�)�$�/��#'����8�8rNc�H�UR[R:Xa#[5UlURcSUlUR[R:XaC[URURSURSURSS9Ulgg)Nr"r r!)�smartos_typer"r r!)rVr�UNSET�get_smartos_environrR�jmc_client_factoryr:�rIs rLrH�DataSourceSmartOS._init�s�������
�
�-� 3� 5�D��� � �(�!%����>�>�W�]�]�*�/�!�.�.�"&�+�+�.A�"B�"�k�k�/�:�#�{�{�+;�<�	�D�N�+rNc��[RS5 Sn[RR	SRUS/55(a:[R"SRUS/5SRUS/55 gg)aSMark the instance provisioning state as successful.

When run in a zone, the host OS will look for /var/svc/provisioning
to be renamed as /var/svc/provision_success.   This should be done
after meta-data is successfully retrieved and from this point
the host considers the provision of the zone to be a success and
keeps the zone running.
z-Instance provisioning state set as successfulz/var/svc�/�provisioning�provision_successN)�LOG�debugrBrC�existsrD�rename)rI�svc_paths  rL�_set_provisioned�"DataSourceSmartOS._set_provisioned�sl��	�	�	�A�B���
�7�7�>�>�#�(�(�H�n�#=�>�?�?��I�I����(�N�3�4����(�$7�8�9�
�@rNc���UR5 0nSnUR(d[RS5 gURR5(d![RSUR5 gURR
5 [R5H$up4UupVURRXVS9X'M& [R5H"up5URRU5X'M$ URR5 [RRUR R#5SUSS5n[RRUS	5nS
[$-n	['URS	5UU	SSS
9 [RRUS5n
['URS5U
SSS9 URS5nS[$-n['X�5 US(dUS(a	USUS'OUSUS'SnUS(aUSnUS(dG[(UU
[RRUR R#S5S5S.-US'[*R,"XR./5UlX lUSUlUSUlUSUlUR95 g)N�zNot running on smartosFz4No metadata device '%r' found for SmartOS datasource��strip�	instancesr�datarz%s/user-scriptTi�)�	content_f�link�shebang�moder)rmrorprz%s/mdata-user-datarr
r
rr6zper-boot)�user_script�operator_script�
per_boot_drr)rHrVr`rarRrb�open_transport�SMARTOS_ATTRIB_MAP�items�get�SMARTOS_ATTRIB_JSON�get_json�close_transportrBrCrDrErF�
LEGACY_USER_D�write_boot_content�BUILTIN_VENDOR_DATArr9r>�userdata_raw�vendordata_rawr?rAre)
rI�md�ud�ci_noun�	attribute�smartos_nounrj�data_drq�
u_script_lrr�u_data�u_data_fs
             rL�	_get_data�DataSourceSmartOS._get_data�s����
�
��
��
��� � ��I�I�.�/���~�~�$�$�&�&��I�I�F����
��	
���%�%�'�"4�":�":�"<��G�"+��L��.�.�,�,�\�,�G�B�K�#=�&9�%>�%>�%@�!�G��.�.�1�1�,�?�B�K�&A�	
���&�&�(�������J�J� � �"�K��M�1B�F�
���g�g�l�l�6�=�9��%�
�5�
���F�F�=�!�!����	
��'�'�,�,�v�/@�A����F�F�$�%�%���		
����*�+��'�-�7���6�,��"�#��*�~�')�*�~��#�$�')�-�'8��#�$�
��
�k�?��K��B��-� � 3�*�#2� �g�g�l�l��J�J�(�(��3�Z��7�!�B�}���*�*�B�
�
�+>�?��
��� ��/����~�.����h�<�������rNc��S[-$)Nzserial (%s))�
SERIAL_DEVICErZs rL�_get_subplatform�"DataSourceSmartOS._get_subplatformLs
���}�,�,rNc�>�URSRU5$)Nr&)r:rw)rI�names  rL�device_name_to_device�'DataSourceSmartOS.device_name_to_deviceOs���{�{�>�*�.�.�t�4�4rNc�:�UR[:Xa[$0$�N)rV�SMARTOS_ENV_KVM�BUILTIN_CLOUD_CONFIGrZs rL�get_config_obj� DataSourceSmartOS.get_config_objRs������/�'�'��	rNc� �URS$)Nr)r>rZs rL�get_instance_id�!DataSourceSmartOS.get_instance_idWs���}�}�]�+�+rNc��UR[R:XaSUlURcLURb?[	URUR
SUR
SURS9UlUR$)Nrr�r?rrr)r@rrWr?�convert_smartos_network_datar>rArZs rL�network_config� DataSourceSmartOS.network_configZs{�����7�=�=�0�#'�D� ����'�� � �,�'C�!%�!2�!2� $�
�
�m� <�#�}�}�\�:��+�+�	(��$��#�#�#rN)
r@r:rRr>r?rArGrVr~rN)�__name__�
__module__�__qualname__�__firstlineno__�dsnamerrWrVrRr�NETWORKr	�BOOT_NEW_INSTANCE�BOOT�BOOT_LEGACY�default_update_eventsr8rQrHrer�r�r�r�r��propertyr��__static_attributes__�rNrLr2r2�s���
�F��=�=�L��
�
�I�����'�'��N�N��!�!�
����&9���$a�F-�5��
,��
$��
$rNr2c��\rSrSrSrg)�JoyentMetadataFetchExceptionikr�N�r�r�r�r�r�r�rNrLr�r�k���rNr�c��\rSrSrSrg)�JoyentMetadataTimeoutExceptionior�Nr�r�rNrLr�r�or�rNr�c��\rSrSrSr\R"S5rSSjrSr	Sr
SrS	rS
r
SSjrSSjrSS
jrSrSrSrSrSrSrSrg)�JoyentMetadataClientisz�
A client implementing v2 of the Joyent Metadata Protocol Specification.

The full specification can be found at
http://eng.joyent.com/mdata/protocol.html
z~V2 (?P<length>\d+) (?P<checksum>[0-9a-f]+) (?P<body>(?P<request_id>[0-9a-f]+) (?P<status>SUCCESS|NOTFOUND)( (?P<payload>.+))?)Nc�6�Uc
[5nXlX lgr�)rXrV�fp)rIrVr�s   rLr8�JoyentMetadataClient.__init__�s����.�0�L�(���rNc�p�SR[R"URS55S-5$)N�{0:08x}zutf-8���)�format�binascii�crc32�encode)rI�bodys  rL�	_checksum�JoyentMetadataClient._checksum�s/������N�N�4�;�;�w�/�0�:�=�
�	
rNc	�`�URRU5R5n[US5[	US5:wa*[SR
US[	US555eURUS5nUSU:wa[SR
XCS55eUSU:wa[SR
XS55eURSS5(d[RS	5 g[R"US5n[RS
U5 U$)N�lengthr�z*Incorrect frame length given ({0} != {1}).�checksumz*Invalid checksum (expected: {0}; got {1}).�
request_idz-Request ID mismatch (expected: {0}; got {1}).�payloadzNo value found.zValue "%s" found.)
�
line_regex�match�	groupdict�int�lenr�r�r�rwr`rar�b64d)rI�expected_request_id�frame�
frame_data�expected_checksum�values      rL�_get_value_from_frame�*JoyentMetadataClient._get_value_from_frame�s0���_�_�*�*�5�1�;�;�=�
��z�(�#�$��J�v�,>�(?�?�.�<�C�C��x�(�#�j��.@�*A���
�
!�N�N�:�f�+=�>���j�!�%6�6�.�<�C�C�%�*�'=���
�
�l�#�':�:�.�?�F�F�'�L�)A���
�
�~�~�i��.�.��I�I�'�(���"�"�:�i�#8�9���	�	�%�u�-��rNc�L^�/mU4SjnSnURRS5nU(d[X!"5-5eUS:XaU"5$TRU5 MU![a7nUR
[
R:Xa[X!"5-5UeeSnAff=f)z�
Reads a line a byte at a time until \n is encountered.  Returns an
ascii string with the trailing newline removed.

If a timeout (per-byte) is set and it expires, a
JoyentMetadataFetchException will be thrown.
c�D>�SRT5RS5$)NrN�ascii)rD�decode)�responses�rL�as_ascii�0JoyentMetadataClient._readline.<locals>.as_ascii�s����8�8�H�%�,�,�W�5�5rNzPartial response: '%s'��
N)r��readr��append�OSError�errno�EAGAIN)rIr��msg�byte�excr�s     @rL�	_readline�JoyentMetadataClient._readline�s������	6�'���
��w�w�|�|�A����8��x�z�9I�J�J��5�=�#�:�%�����%����
��9�9����,�8��h�j�(������
�s�AA"�A"�"
B#�,2B�B#c��URRURS55 URR5 g)Nr�)r��writer��flush)rIr�s  rL�_write�JoyentMetadataClient._write�s(�����
�
�c�j�j��)�*����
�
�rNc���[RS5 URS5 UR5n[RSU5 US:wa[	SU-5e[RS5 g)NzNegotiating protocol V2z
NEGOTIATE V2
z	read "%s"�V2_OKz'Invalid response "%s" to "NEGOTIATE V2"zNegotiation complete)r`rar�r�r�)rIr�s  rL�
_negotiate�JoyentMetadataClient._negotiate�sb���	�	�+�,����$�%��>�>�#���	�	�+�x�(��w��.�9�H�D��
�	�	�	�(�)rNc��SR[R"SS55nSRUU45nU(a8US[R
"UR
55R5--
nSR[U5URU5U5n[RSU5 SnUR(dUR5 SnURU5 UR5nU(aUR!5 [RS	U5 S
U;agUR#X75nU$)Nr�rr�� zV2 {0} {1} {2}
z#Writing "%s" to metadata transport.FTz"Read "%s" from metadata transport.�SUCCESS)r��random�randintrD�base64�	b64encoder�r�r�r�r`rar�rtr�r�rzr�)	rI�rtype�paramr��message_bodyr��
need_closer�r�s	         rL�request�JoyentMetadataClient.request�s
���%�%�f�n�n�Q�
�&C�D�
��x�x���
�
����C�&�"2�"2�5�<�<�>�"B�"I�"I�"K�K�K�L� �'�'����t�~�~�l�;�\�
��	�	�	�7��=��
��w�w����!��J����C���>�>�#���� � �"��	�	�6��A��H�$���*�*�:�@���rNc�l�URSUS9nUcU$U(aU(aUR5nU$)N�GET�r�r�)r�rj)rI�key�defaultrj�results     rLrw�JoyentMetadataClient.get�s3�����E���5���>��N��e��\�\�^�F��
rNc�V�URXS9nUcU$[R"U5$)N)r)rw�json�loads)rIrrrs    rLry�JoyentMetadataClient.get_json�s+�����#��/���>��N��z�z�&�!�!rNc�T�URSS9nU(d/$URS5$)N�KEYS)r��
)r��split)rIrs  rL�list�JoyentMetadataClient.lists)�����F��+����I��|�|�D�!�!rNc	���SRX4Vs/sH'n[R"UR55PM) sn5R	5nURSUS9$s snf)N� �PUTr)rDr�r�r�r�r�)rIr�val�ir�s     rL�put�JoyentMetadataClient.put	sY���	�	�47�:�>�:�a�V�
�
�a�h�h�j�
)�:�>�
�
�&�(�	��|�|�%�u�|�5�5��
?s�.A$c�j�UR(a"URR5 SUlggr�)r��closerZs rLrz�$JoyentMetadataClient.close_transports"���7�7��G�G�M�M�O��D�G�rNc�L�UR(aU$UR5 U$r�)r�rtrZs rL�	__enter__�JoyentMetadataClient.__enter__s���7�7��K������rNc�$�UR5 gr�)rz)rI�exc_type�	exc_value�	tracebacks    rL�__exit__�JoyentMetadataClient.__exit__s������rNc��[er�)�NotImplementedErrorrZs rLrt�#JoyentMetadataClient.open_transports��!�!rN)r�rV�NNr��NF)r�r�r�r��__doc__�re�compiler�r8r�r�r�r�r�r�rwryr
rrzrr rtr�r�rNrLr�r�ssh������	 ��J��
�
�8�:�	*��B�"�"�6��
��"rNr�c�@^�\rSrSr\4U4SjjrSrSrSrSr	U=r
$)�JoyentMetadataSocketClienti"c�8>�[[U]U5 Xlgr�)�superr+r8�
socketpath)rIr.rV�	__class__s   �rLr8�#JoyentMetadataSocketClient.__init__#s���
�(�$�8��F�$�rNc���[R"[R[R5nURUR5 URS5UlUR5 g)N�rwb)�socket�AF_UNIX�SOCK_STREAM�connectr.�makefiler�r�)rI�socks  rLrt�)JoyentMetadataSocketClient.open_transport'sF���}�}�V�^�^�V�-?�-?�@�����T�_�_�%��-�-��&������rNc�T�[RRUR5$r�)rBrCrbr.rZs rLrb�!JoyentMetadataSocketClient.exists-s���w�w�~�~�d�o�o�.�.rNc�R�URR<SUR<S3$)Nz(socketpath=�))r/r�r.rZs rL�__repr__�#JoyentMetadataSocketClient.__repr__0s��&*�n�n�&=�&=�t���O�OrN)r�r.)r�r�r�r��SMARTOS_ENV_LX_BRANDr8rtrbr>r��
__classcell__�r/s@rLr+r+"s!���0D�%��/�P�PrNr+c�J^�\rSrSrS\S4U4SjjrSrSrSrSr	S	r
U=r$)
�JoyentMetadataSerialClienti4�
Nc�D>�[[U]X45 XlX lgr�)r-rDr8r.�timeout)rIr.rGrVr�r/s     �rLr8�#JoyentMetadataSerialClient.__init__5s���	�(�$�8��J����rNc�T�[RRUR5$r�)rBrCrbr.rZs rLrb�!JoyentMetadataSerialClient.exists<s���w�w�~�~�d�k�k�*�*rNc��URc�SSKnUR	UR
URS9nUR5(d[SUR
-5eX0l[R"U[R5 UR5 UR5 g![an[S5UeSnAff=f)Nrzserial support is not available)rGzUnable to open %s)r��serial�ImportErrorr#�Serialr.rG�isOpen�SystemError�fcntl�lockf�LOCK_EX�_flushr�)rIrL�e�sers    rLrt�)JoyentMetadataSerialClient.open_transport?s����7�7�?�
��
�-�-����T�\�\�-�B�C��:�:�<�<�!�"5����"C�D�D��G��K�K��U�]�]�+����
�������
�)�5�����
�s�B0�0
C�:C�Cc��[RS5 URRnSURlUR	5 M![
a Of=f[RS5 US:�aSURlOXRl[RS5 UR
S5 UR	5nUS:XaO[US:Xa[RS	5 M\[RS
U5 O%![
a [RS5 Of=fM�[RS5 XRlg)
NzFlushing inputg�������?zInput empty�z,Writing newline, expecting "invalid command"rzinvalid command�FAILUREzGot "FAILURE".  Retrying.z%Unexpected response "%s" during flushzQTimeout while initializing metadata client. Is the host metadata service running?z'Got "invalid command".  Flush complete.)r`rar�rGr�r�r��warning)rIrGr�s   rLrT�!JoyentMetadataSerialClient._flushOs���	�	�"�#��'�'�/�/��������
���� ���2�
��
���	�	�-� ��Q�;��D�G�G�O�%�G�G�O���I�I�D�E��K�K���
��>�>�+���0�0���y�(��I�I�9�:�����C�X�N��1�
����<��
��� 	�	�	�;�<�!���s/�A�
A�A�D�D�:D�D3�2D3c�n�URR<SUR<SUR<S3$)Nz(device=z
, timeout=r=)r/r�r.rGrZs rLr>�#JoyentMetadataSerialClient.__repr__vs'���N�N�#�#��K�K��L�L�
�	
rN)r.r�rG)r�r�r�r�r�r8rbrtrTr>r�rArBs@rLrDrD4s)��� ��4��+�� %"�N
�
rNrDc�^^�\rSrSrSrS	U4SjjrS
SjrSU4SjjrS
SjrSSjr	Sr
U=r$)� JoyentMetadataLegacySerialClienti~a�V1 of the protocol was not safe for all values.
Thus, we allowed the user to pass values in as base64 encoded.
Users may still reasonably expect to be able to send base64 data
and have it transparently decoded.  So even though the V2 format is
now used, and is safe (using base64 itself), we keep legacy support.

The way for a user to do this was:
  a.) specify 'base64_keys' key whose value is a comma delimited
      list of keys that were base64 encoded.
  b.) base64_all: string interpreted as a boolean that indicates
      if all keys are base64 encoded.
  c.) set a key named b64-<keyname> with a boolean indicating that
<keyname> is base64 encoded.c�f>�[[U5nURXU5 SUlSUlgr�)r-r`r8r$r%)rIr.rGrV�sr/s     �rLr8�)JoyentMetadataLegacySerialClient.__init__�s-����2�D�9��	�
�
�6�L�1������rNc���U(aSUlSUlSnURcHUR5nSU;a+[R"URS55UlOSUlUR(agURc�UcUR5n[
5nSU;a)[
URS5RS55nUVs/sHoDRS5(dMUSSPM! snHXn[R"URU55(aURU5 M@XS;dMGURU5 MZ X0lggs snf)Nr%Fr$�,zb64-�)r$r%r
r�is_true�_get�setr�
startswith�add�remove)rI�reset�keys�b64_keys�krs      rL�_init_base64_keys�2JoyentMetadataLegacySerialClient._init_base64_keys�s���#�D��"�D�O����?�?�"��9�9�;�D��t�#�"&�,�,�t�y�y��/F�"G���"'����?�?�����#��|��y�y�{���u�H���$��t�y�y��7�=�=�c�B�C��(,�D�t�!�|�|�F�/C���!�"��t�D���<�<��	�	�#��/�/��L�L��%��� ����,�E� (��$��Es�E)�9	E)c�(>�[[U]XUS9$)N)rrj)r-r`rw)rIrrrjr/s    �rLrh�%JoyentMetadataLegacySerialClient._get�s#����5�t�@���A�
�	
rNc�v�U[;agURUS9 UR(agXR;$)NF)rmT)�NO_BASE64_DECODErqr%r$)rIrrms   rL�is_b64_encoded�/JoyentMetadataLegacySerialClient.is_b64_encoded�s8���"�"�����U��+��?�?���&�&�&�&rNc�h�[5nURUSUS9nXTLaU$URU5(a3[R"UR55R
5nU(aUR5nU$![Ra [RSX5 NEf=f)NF)rjrz#Failed base64 decoding key '%s': %s)�objectrhrwr��	b64decoder�r�r��Errorr`r[rj)rIrrrj�mdefaultrs      rLrw�$JoyentMetadataLegacySerialClient.get�s����8���i�i��5�(�i�;���?��N����s�#�#�
M��&�&�s�z�z�|�4�;�;�=����)�)�+�C��
��
�>�>�
M����A�3�L�
M�s�2B�*B1�0B1)r%r$)rEN)Fr&)r�r�r�r�r'r8rqrhrwrwr�rArBs@rLr`r`~s'���$�� (�D
�
'��rNr`c��Uc[U5nUcgU[:Xa[UUUS9$U[:Xa	[	XS9$[SU-5e)N)r.rGrV)r.rVz"Unknown value for smartos_type: %s)rXr�r`r@r+�
ValueError)rVr"r r!�
uname_versions     rLrYrY�si����*�=�9�����	��	(�/� �"�%�
�	
�

�-�	-�)�(�
�	
��9�L�H�
I�IrNc��SSSU/nSn[R"U5up#[RSX5 UcS$UR
5$![Ra*n[R
"[SU-U45 SnANNSnAff=f)N�filez--briefz--mime-typezscript %s mime type is %sz%Failed to identify script type for %s)rr`ra�ProcessExecutionErrorr�logexcrj)rm�cmd�f_type�_errrUs     rL�
identify_filer��s����9�m�Y�
7�C�
�F�
����3�����	�	�-�y�A�
�>�4�5�v�|�|�~�5��	�%�%�
�����9�I�E�q�I�	
�	
��
�s�.A
�
B�! B�Bc���U(d:[RRU5(a[R"U5 U(a:[RR	U5(a[R"U5 U(dg[
R"XUS9 U(adURS5(dN[U5nUS:Xa=[
R"USRSU/5US9 [RSU5 U(a�[RR	U5(a[R"U5 U(ao[RRU5(aJ[
R"[RRU55 [R"X5 gggg![a&n[
R "[SU5 SnAgSnAff=f)	a�
Write the content to content_f. Under the following rules:
    1. If no content, remove the file
    2. Write the content
    3. If executable and no file magic, add it
    4. If there is a link, create it

@param content: what to write
@param content_f: the file name
@param backup_d: the directory to save the backup at
@param link: if defined, location to create a symlink to
@param shebang: if no file magic, set shebang
@param mode: file mode

Because of the way that Cloud-init executes scripts (no shell),
a script will fail to execute if does not have a magic bit (shebang) set
for the file. If shebang=True, then the script will be checked for a magic
bit and to the SmartOS default of assuming that bash.
N)rpz#!z
text/plainrz#!/bin/bashzadded shebang to file %sz$failed establishing content link: %s)rBrCrb�unlink�islinkr�
write_filerjr�rDr`ra�
ensure_dir�dirname�symlink�IOErrorr�)�contentrmrnrorpr�rUs       rLr|r|�sE��.�r�w�w�~�~�i�0�0�
�	�	�)��������t�$�$�
�	�	�$�����O�O�I�T�2��w�)�)�$�/�/��y�)���\�!��O�O��4�9�9�m�W�%=�>�T�
�
�I�I�0�)�<��	H��w�w�~�~�d�#�#��	�	�$���2�7�7�>�>�)�4�4���������� 5�6��
�
�9�+�5�w�	���	H��K�K��C�Q�G�G��	H�s�B.G�
G5�G0�0G5c���[R"5nUcUSnUS:Xa[$Uc[R"S5nOUnU(aURS5(a[$g)NrfzBrandZ virtual linuxzsystem-product-name�SmartDC)rB�unamer@r�
read_dmi_datarjr�)r��product_namer��system_types    rLrXrX1se���H�H�J�E����a��
��.�.�#�#����'�'�(=�>��"���{�-�-�i�8�8���rNc�X^�/SQ/SQSS/S.mU(a[U[[45(dU/nO/nU(a[U[[45(dU/nO/nU(d/nSnSnUSS	.USS	.S
.n/nUGHn[U4SjUR	555n	U	RSUS
S.5 SU;aU	RSUS05 /n
UR
S/5GHnnUS:XaSS0nGOMUS:XaSS0nGOA/n
[U4SjUR	555nURSUS.5 U"U5(aSOSnSU;a�UR
SS5(atXnS(dhUR
S/5Vs/sHnXnS "U5(dMUPM nn[U5(a"US!XnS'URSXnS05 UH`n[U4S"jUR	555nURSUS#05 U
RU5 URS$U
05 Mb U
RU5 GMq U	RS%U
05 URU	5 GM U(aURS&UUS'.5 S(US).$s snf)*a�Return a dictionary of network_config by parsing provided
   SMARTOS sdc:nics configuration data

sdc:nics data is a dictionary of properties of a nic and the ip
configuration desired.  Additional nic dictionaries are appended
to the list.

Converting the format is straightforward though it does include
duplicate information as well as data which appears to be relevant
to the hostOS rather than the guest.

For each entry in the nics list returned from query sdc:nics, we
create a type: physical entry, and extract the interface properties:
'mac' -> 'mac_address', 'mtu', 'interface' -> 'name'.  The remaining
keys are related to ip configuration.  For each ip in the 'ips' list
we create a subnet entry under 'subnets' pairing the ip to a one in
the 'gateways' list.

Each route in sdc:routes is mapped to a route on each interface.
The sdc:routes properties 'dst' and 'gateway' map to 'network' and
'gateway'.  The 'linklocal' sdc:routes property is ignored.
)�mac_address�mtur��params�subnets�type)	�address�	broadcast�dns_nameservers�
dns_search�metric�pointopointr�scoper��network�gateway)�physical�subnet�routec��SU;$)N�.r���addrs rL�
is_valid_ipv4�3convert_smartos_network_data.<locals>.is_valid_ipv4�����d�{�rNc��SU;$)N�:r�r�s rL�
is_valid_ipv6�3convert_smartos_network_data.<locals>.is_valid_ipv6�r�rNN)r��gw)�ipv4�ipv6c3�D># �UHupUTS;dMX4v� M g7f)r�Nr���.0rp�v�
valid_keyss   �rL�	<genexpr>�/convert_smartos_network_data.<locals>.<genexpr>�s&����
�*�t�q�a�:�j�3I�.I�F�Q�F�{��� �
 r��	interface)r�r��macr��ips�dhcpr��dhcp4�addrconf�dhcp6c3�D># �UHupUTS;dMX4v� M g7f)r�Nr�r�s   �rLr�r��s&�����'2�t�q�a�:�h�;O�6O�F�Q�F�{�r��static)r�r�r�r��primaryFr��gatewaysr�rc3�D># �UHupUTS;dMX4v� M g7f)r�Nr�r�s   �rLr�r��s+���� �$1�D�A��
�7� 3�3����$1�r��dstrr��
nameserver)r�r��searchr�)�version�config)	�
isinstancer
�tuple�dictrv�updaterwr�r�)r?rrrr�r��pgwsr��nic�cfgr��ipr��	routeents�protor�r�r��rcfgr�s                   @rLr�r�Gs����6
�

�
��
�)�J�4��+��e�}�5�5�&�-�K������*�t�U�m�4�4�$��J���
������(�t�4�'�t�4��D�
�F����
�"�y�y�{�
�
��	�
�
�J��K�0@�A�B��C�<��J�J�
�s�5�z�2�3����'�'�%��$�B��V�|� �'�*���z�!� �'�*���	���'*�y�y�{�����
�
� (�#%���#0��"3�"3������#����	�5�(A�(A�
 �;�t�,�'*�g�g�j�"�&=�$�&=��#�{�7�3�B�7��&=�!�$�
�x�=�=�08���D�K��-�"�M�M�9�d�k�$�6G�*H�I�#�E�� �$)�K�K�M� ��D�"�K�K��E�%�L� 9�:��$�$�T�*��M�M�8�Y�"7�8�)$�,
�N�N�6�"�q%�r	�
�
�I�w�'�(��
�
�c��G�J��
�
�$�&�$�
�	
��F�+�+��Y$s�
J'�'J'c�8�[R"U[5$r�)r�list_from_depends�datasources)�dependss rL�get_datasource_listr��s���$�$�W�k�:�:rN�__main__zDo not appear to be on smartos.r�r�c�6�X;aX!$U[;a [UnURU5X!'X!$US:Xa3SHn[XU5 M [USUSUSUSS9X!'X!$U[;a[Uup5OUSpSURX5S	9X!'X!$)
Nr�)rrrrrrrrr�Fri)rxry�load_keyr�rurw)�clientrrl�keyname�depkeyrjs      rLr�r�s����;��9���%�%�)�#�.�G�����0�D�I�,�y��+�$�
$������.�
�5�!�.�1� ��/���-��H�~�	�D�I��y��
�(�(�!3�C�!8����"%�u���
�
�7�
�8�D�I��y�rNrl)r�rrlT)rez: )�indent�	sort_keys�
separators)NF�r%)NNNN)Cr�r�r�rQr�loggingrBr�r(r3�	cloudinitrrrrr�cloudinit.eventrr	�	getLoggerr�r`rurxr@r��DS_NAMEr<rv�METADATA_SOCKFILEr��SERIAL_TIMEOUTr=r�r}r{r7r2�	Exceptionr�r�r�r+rDr`rYr�r|rXr��DEP_FILESYSTEMr�r��sys�jmc�print�exitr��argvr
rnr�rlr��__annotations__r�dumpsr�rNrL�<module>r�s���.������	�
�	�
�=�=�1�
����!��&�(�1�)�,�0�2�,�6�-�5�&�*���&�"��	��"����
���W�%����9���
���"#�$�*�(���!�:�.���	����
���f��M����8��8�
�D$��*�*�D$�N	�9�	�	�%A�	�l"�l"�^P�!5�P�$G
�!5�G
�TU�'A�U�r�'��!��J�6
6�8=�0H�f�.BF�],�D��/�/�1�2���;��z���
�
�C�
�{�
�/�0������
�3�8�8�}����$�)�)�+�,��%�*�*�,�-�
.�� �
!�	
��x�x���|���<�D�$�O������4�0��
�$�*�*�T�!�t��
L�M�erN

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