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__/DataSourceSmartOS.cpython-314.pyc
+
��i��� a�ROtB0t^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RI	t	^RI
t
^RIHtH
t
HtHtHt^RIHtHt]P(!]4tRRPRRQRRRR	RSRRTRRUR
RVRRWRRXRRYRRZRR[RR\/
tRRRRRR/tRtRtRtR].t.R]OtRtRt^<t R]R ] R!]R"]R#.R$R
R%R&R'//t!R(R&R)R*R+R
R,R
//R-R.R&R/R0R1R&/./t"R2t#R3t$!R4R5]PJ4t&!R6R7]'4t(!R8R9](4t)!R:R;4t*!R<R=]*4t+!R>R?]*4t,!R@RA],4t-R]]] R3RBlt.RCt/R^RDlt0R_RElt1R`RFlt2]&]Pf33.t4RGt5]RH8Xd�^RI6t6].!4t7]7f]8!RI4]6Pr!^4]:!]6Pv4^8Xd;]<!]P{44]<!]P{44,RJ.,t=M]6PvRK,t=RLt>/t?]^k]=Ft@]>!]7]@]?RM7K	]8!]P�!]?^RRaRN74R#R#)b�N)�
atomic_helper�dmi�sources�subp�util)�
EventScope�	EventType�instance-idT�local-hostname�hostnamezpublic-keys�user-scriptF�legacy-user-data�	user-data�iptables_disable�
motd_sys_info�availability_zone�vendor-data�operator-script�
dns_domain�network-datazsdc:nics�dns_serversz
sdc:resolvers�routesz
sdc:routeszlx-brand�kvm�SmartOS�
datasourcez"/native/.zonecontrol/metadata.sockz
/dev/ttyS1�
serial_device�serial_timeout�metadata_sockfile�no_base64_decode�base64_keys�
base64_all�disk_aliases�
ephemeral0z/dev/vdb�
disk_setup�
table_type�mbr�layout�	overwrite�fs_setup�label�
filesystem�ext4�deviceaU#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�a�]tRt^�toRt]Pt]Pt]	P]P]P]P0/tRtRtRtRtRtRtRtR	tR
t]R4tRtVtR
#)�DataSourceSmartOS�Joyentc��\PPWW#4\P!VP
\P!V\/4\.4Vn/Vn	RVn
RVnRVn\PPVP P#R44VnVP'4R#)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�distrorAs&&&&�E/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceSmartOS.pyr4�DataSourceSmartOS.__init__�s������#�#�D�6�A��(�(�����$�$�W�k�2�>�!�
�
�����
� ���#�������W�W�\�\�$�*�*�*>�*>�y�*I�J����
�
��c�h�\PPV4pV:RVP:R2#)z	 [client=�])rr3�__str__�	md_client)rE�roots& rHrM�DataSourceSmartOS.__str__�s'���!�!�)�)�$�/��#'����8�8rJc�p�VP\P8Xd%\4VnVPfRVnVP\P8XdT\VPVPR,VPR,VPR,R7VnR#R#)Nrrr)�smartos_typerrr)rRr�UNSET�get_smartos_environrN�jmc_client_factoryr6�rEs&rHrD�DataSourceSmartOS._init�s�������
�
�-� 3� 5�D��� � �(�!%����>�>�W�]�]�*�/�!�.�.�"&�+�+�.A�"B�"�k�k�/�:�#�{�{�+;�<�	�D�N�+rJc��\PR4Rp\PP	RPVR.44'd<\P!RPVR.4RPVR.44R#R#)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�debugr>r?�existsr@�rename)rE�svc_paths& rH�_set_provisioned�"DataSourceSmartOS._set_provisioned�sl��	�	�	�A�B���
�7�7�>�>�#�(�(�H�n�#=�>�?�?��I�I����(�N�3�4����(�$7�8�9�
�@rJc�l�VP4/pRpVP'g\PR4R#VPP4'g#\PRVP4R#VPP
4\P4F'wr4VwrVVPPWVR7W&K)	\P4F"wr5VPPV4W&K$	VPP4\PPVP P#4RVR,R4p\PPVR4pR	\$,p	\'VPR4VV	R
RR7\PPVR
4p
\'VPR
4V
RRR7VPR4pR\$,p\'W�4VR,'g)VR,'dVR,VR&MVR,VR&RpVR,'d
VR,pVR,'gN\(RVRV
R\PPVP P#R4R4/,VR&\*P,!WP..4VnW nVR,VnVR,VnVR,VnVP94R
#)�zNot running on smartosFz4No metadata device '%r' found for SmartOS datasource��strip�	instancesr
�datar
z%s/user-scriptTi�)�	content_f�link�shebang�moder)rirkrlrz%s/mdata-user-datarrNrr�user_script�operator_script�
per_boot_dr2zper-bootrr)rDrRr\r]rNr^�open_transport�SMARTOS_ATTRIB_MAP�items�get�SMARTOS_ATTRIB_JSON�get_json�close_transportr>r?r@rArB�
LEGACY_USER_D�write_boot_content�BUILTIN_VENDOR_DATArr5r:�userdata_raw�vendordata_rawr;r=ra)
rE�md�ud�ci_noun�	attribute�smartos_nounrf�data_drm�
u_script_lrn�u_data�u_data_fs
&            rH�	_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��{�!�?��b�g�g�l�l��J�J�(�(��3�Z��7�!�B�}���*�*�B�
�
�+>�?��
��� ��/����~�.����h�<�������rJc��R\,#)zserial (%s))�
SERIAL_DEVICErVs&rH�_get_subplatform�"DataSourceSmartOS._get_subplatformLs
���}�,�,rJc�F�VPR,PV4#)r")r6rs)rE�names&&rH�device_name_to_device�'DataSourceSmartOS.device_name_to_deviceOs���{�{�>�*�.�.�t�4�4rJc�<�VP\8Xd\#/#�N)rR�SMARTOS_ENV_KVM�BUILTIN_CLOUD_CONFIGrVs&rH�get_config_obj� DataSourceSmartOS.get_config_objRs������/�'�'��	rJc�(�VPR,#)r
)r:rVs&rH�get_instance_id�!DataSourceSmartOS.get_instance_idWs���}�}�]�+�+rJc�2�VP\P8XdRVnVPfYVPeK\	VPVP
R,VP
R,VPR7VnVP#)Nrr�r;rrr)r<rrSr;�convert_smartos_network_datar:r=rVs&rH�network_config� DataSourceSmartOS.network_configZs{�����7�=�=�0�#'�D� ����'�� � �,�'C�!%�!2�!2� $�
�
�m� <�#�}�}�\�:��+�+�	(��$��#�#�#rJ)
r<r6rNr:r;r=rCrRrzr{N)�__name__�
__module__�__qualname__�__firstlineno__�dsnamerrSrRrNr�NETWORKr	�BOOT_NEW_INSTANCE�BOOT�BOOT_LEGACY�default_update_eventsr4rMrDrar�r�r�r�r��propertyr��__static_attributes__�__classdictcell__��
__classdict__s@rHr/r/�s�����
�F��=�=�L��
�
�I�����'�'��N�N��!�!�
����&9���$a�F-�5��
,��
$��
$rJr/c��]tRtRtRtR#)�JoyentMetadataFetchExceptionik�N�r�r�r�r�r�r�rJrHr�r�k���rJr�c��]tRtRtRtR#)�JoyentMetadataTimeoutExceptionior�Nr�r�rJrHr�r�or�rJr�c�a�]tRtRtoRt]P!R4tRRltRt	Rt
RtR	tR
t
RRltRRltRR
ltRtRtRtRtRtRtRtVtR#)�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�:�Vf\4pWnW nR#r�)rTrR�fp)rErRr�s&&&rHr4�JoyentMetadataClient.__init__�s����.�0�L�(���rJc�x�RP\P!VPR44R,4#)�{0:08x}zutf-8���)�format�binascii�crc32�encode)rE�bodys&&rH�	_checksum�JoyentMetadataClient._checksum�s/������N�N�4�;�;�w�/�0�:�=�
�	
rJc	��VPPV4P4p\VR,4\	VR,48wd3\RP
VR,\	VR,444hVPVR,4pVR,V8wd"\RP
WCR,44hVR,V8wd"\RP
WR,44hVPRR4'g\PR	4R#\P!VR,4p\PR
V4V#)�lengthr�z*Incorrect frame length given ({0} != {1}).�checksumz*Invalid checksum (expected: {0}; got {1}).�
request_idz-Request ID mismatch (expected: {0}; got {1}).�payloadNzNo value found.zValue "%s" found.)
�
line_regex�match�	groupdict�int�lenr�r�r�rsr\r]r�b64d)rE�expected_request_id�frame�
frame_data�expected_checksum�values&&&   rH�_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�-��rJc�da�.oV3RlpRpVPP^4pV'g\W!!4,4hVR8XdV!4#SPV4K\ \d=pTP
\
P8Xd\Y!!4,4ThhRp?ii;i)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<�RPS4PR4#)rJ�ascii)r@�decode)�responses�rH�as_ascii�0JoyentMetadataClient._readline.<locals>.as_ascii�s����8�8�H�%�,�,�W�5�5rJzPartial response: '%s'�
N)r��readr��append�OSError�errno�EAGAIN)rEr��msg�byte�excr�s&    @rH�	_readline�JoyentMetadataClient._readline�s������	6�'���
��w�w�|�|�A����8��x�z�9I�J�J��5�=�#�:�%�����%���
��9�9����,�8��h�j�(������
�s"�"A(�#A(�A(�(B/�37B*�*B/c��VPPVPR44VPP4R#)r�N)r��writer��flush)rEr�s&&rH�_write�JoyentMetadataClient._write�s(�����
�
�c�j�j��)�*����
�
�rJc��\PR4VPR4VP4p\PRV4VR8wd\	RV,4h\PR4R#)zNegotiating protocol V2z
NEGOTIATE V2
z	read "%s"�V2_OKz'Invalid response "%s" to "NEGOTIATE V2"zNegotiation completeN)r\r]r�r�r�)rEr�s& rH�
_negotiate�JoyentMetadataClient._negotiate�sb���	�	�+�,����$�%��>�>�#���	�	�+�x�(��w��.�9�H�D��
�	�	�	�(�)rJc��RP\P!^R44pRPVV34pV'dAVR\P
!VP
44P4,,
pRP\V4VPV4V4p\PRV4RpVP'gVP4RpVPV4VP4pV'dVP!4\PRV4RV9dR	#VP#W74pV#)
r�r�� zV2 {0} {1} {2}
z#Writing "%s" to metadata transport.FTz"Read "%s" from metadata transport.�SUCCESSN)r��random�randintr@�base64�	b64encoder�r�r�r�r\r]r�rpr�r�rvr�)	rE�rtype�paramr��message_bodyr��
need_closer�r�s	&&&      rH�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�w����!��J����C���>�>�#���� � �"��	�	�6��A��H�$���*�*�:�@���rJc�x�VPRVR7pVfV#V'dV'dVP4pV#)�GET�r�r�)r�rf)rE�key�defaultrf�results&&&& rHrs�JoyentMetadataClient.get�s3�����E���5���>��N��e��\�\�^�F��
rJc�^�VPWR7pVfV#\P!V4#))r)rs�json�loads)rEr�rrs&&& rHru�JoyentMetadataClient.get_json�s+�����#��/���>��N��z�z�&�!�!rJc�\�VPRR7pV'g.#VPR4#)�KEYS)r��
)r��split)rErs& rH�list�JoyentMetadataClient.lists)�����F��+����I��|�|�D�!�!rJc	���RPW3Uu.uF'p\P!VP44NK)	up4P	4pVPRVR7#uupi)� �PUTr�)r@r�r�r�r�r�)rEr��val�ir�s&&&  rH�put�JoyentMetadataClient.put	sY���	�	�47�:�>�:�a�V�
�
�a�h�h�j�
)�:�>�
�
�&�(�	��|�|�%�u�|�5�5��
?s�-A&c�p�VP'd$VPP4RVnR#R#r�)r��closerVs&rHrv�$JoyentMetadataClient.close_transports$���7�7�7��G�G�M�M�O��D�G�rJc�N�VP'dV#VP4V#r�)r�rprVs&rH�	__enter__�JoyentMetadataClient.__enter__s!���7�7�7��K������rJc�&�VP4R#r�)rv)rE�exc_type�	exc_value�	tracebacks&&&&rH�__exit__�JoyentMetadataClient.__exit__s������rJc��\hr�)�NotImplementedErrorrVs&rHrp�#JoyentMetadataClient.open_transports��!�!rJ)r�rR�NNr��NF)r�r�r�r��__doc__�re�compiler�r4r�r�r�r�r�r�rsrurrrvrrrpr�r�r�s@rHr�r�ssp��������	 ��J��
�
�8�:�	*��B�"�"�6��
��"�"rJr�c�Jaa�]tRtRto]3V3RlltRtRtRtRt	Vt
V;t#)�JoyentMetadataSocketClienti"c�:<�\\V`V4WnR#r�)�superr)r4�
socketpath)rEr,rR�	__class__s&&&�rHr4�#JoyentMetadataSocketClient.__init__#s���
�(�$�8��F�$�rJc���\P!\P\P4pVPVP4VPR4VnVP4R#)�rwbN)�socket�AF_UNIX�SOCK_STREAM�connectr,�makefiler�r�)rE�socks& rHrp�)JoyentMetadataSocketClient.open_transport'sF���}�}�V�^�^�V�-?�-?�@�����T�_�_�%��-�-��&������rJc�T�\PPVP4#r�)r>r?r^r,rVs&rHr^�!JoyentMetadataSocketClient.exists-s���w�w�~�~�d�o�o�.�.rJc�R�VPP:RVP:R2#)z(socketpath=�))r-r�r,rVs&rH�__repr__�#JoyentMetadataSocketClient.__repr__0s��&*�n�n�&=�&=�t���O�OrJ)r�r,)r�r�r�r��SMARTOS_ENV_LX_BRANDr4rpr^r<r�r��
__classcell__�r-r�s@@rHr)r)"s#����0D�%��/�P�PrJr)c�Taa�]tRtRto^
]R3V3RlltRtRtRtRt	Rt
VtV;t#)	�JoyentMetadataSerialClienti4Nc�F<�\\V`W44WnW nR#r�)r+rBr4r-�timeout)rEr-rDrRr�r-s&&&&&�rHr4�#JoyentMetadataSerialClient.__init__5s���	�(�$�8��J����rJc�T�\PPVP4#r�)r>r?r^r-rVs&rHr^�!JoyentMetadataSerialClient.exists<s���w�w�~�~�d�k�k�*�*rJc��VPf�^RIpTP	TP
TPR7pTP4'g\RTP
,4hY0n\P!T\P4VP4VP4R# \dp\R4ThRp?ii;i)Nzserial support is not available)rDzUnable to open %s)r��serial�ImportErrorr!�Serialr-rD�isOpen�SystemError�fcntl�lockf�LOCK_EX�_flushr�)rErI�e�sers&   rHrp�)JoyentMetadataSerialClient.open_transport?s����7�7�?�
��
�-�-����T�\�\�-�B�C��:�:�<�<�!�"5����"C�D�D��G��K�K��U�]�]�+����
�������
�)�5�����
�s�B:�:C�C�Cc���\PR4VPPpRVPnVP	4K \
dMi;i\PR4T^8�d^TPnMYPn\PR4TP
R4TP	4pTR8XdM]TR8Xd\PR4K^\PRT4Kv \
d\PR	4K�i;i\PR
4YPnR#)zFlushing inputg�������?zInput emptyz,Writing newline, expecting "invalid command"r	zinvalid 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.N)r\r]r�rDr�r�r��warning)rErDr�s&  rHrQ�!JoyentMetadataSerialClient._flushOs���	�	�"�#��'�'�/�/��������
���� ��1�
��
���	�	�-� ��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� D:�9D:c�n�VPP:RVP:RVP:R2#)z(device=z
, timeout=r;)r-r�r-rDrVs&rHr<�#JoyentMetadataSerialClient.__repr__vs'���N�N�#�#��K�K��L�L�
�	
rJ)r-r�rD)
r�r�r�r�r�r4r^rprQr<r�r�r?r@s@@rHrBrB4s+���� ��4��+�� %"�N
�
rJrBc�haa�]tRtRtoRtR	V3RlltR
RltRV3RlltR
RltRRlt	Rt
VtV;t#)� 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�h<�\\V4pVPWV4RVnRVnR#r�)r+r\r4r r!)rEr-rDrR�sr-s&&&& �rHr4�)JoyentMetadataLegacySerialClient.__init__�s-����2�D�9��	�
�
�6�L�1������rJc��V'dRVnRVnRpVPfJVP4pRV9d,\P!VPR44VnMRVnVP'dR#VPf�VfVP4p\
4pRV9d*\
VPR4PR44pVUu.uF$qDPR4'gKVR,NK&	upFZp\P!VPV44'dVPV4KAWS9gKIVPV4K\	W0nR#R#uupi)Nr!Fr �,zb64-:�NN)r r!rr�is_true�_get�setr
�
startswith�add�remove)rE�reset�keys�b64_keys�kr�s&&    rH�_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�$E9�
E9c�.<�\\V`WVR7#))rrf)r+r\rs)rEr�rrfr-s&&&&�rHrd�%JoyentMetadataLegacySerialClient._get�s#����5�t�@���A�
�	
rJc��V\9dR#VPVR7VP'dR#WP9#)F)riT)�NO_BASE64_DECODErmr!r )rEr�ris&&&rH�is_b64_encoded�/JoyentMetadataLegacySerialClient.is_b64_encoded�s:���"�"�����U��+��?�?�?���&�&�&�&rJc�v�\4pVPVRVR7pWTJdV#VPV4'd4\P!VP44P
4pV'dVP4pV# \Pd\PRY4LGi;i)F)rfrz#Failed base64 decoding key '%s': %s)�objectrdrsr��	b64decoder�r�r��Errorr\rWrf)rEr�rrf�mdefaultrs&&&&  rHrs�$JoyentMetadataLegacySerialClient.get�s����8���i�i��5�(�i�;���?��N����s�#�#�
M��&�&�s�z�z�|�4�;�;�=����)�)�+�C��
��
�>�>�
M����A�3�L�
M�s�2B
�
+B8�7B8)r!r )�
N)Fr$)
r�r�r�r�r%r4rmrdrsrsr�r�r?r@s@@rHr\r\~s)����$�� (�D
�
'��rJr\c��Vf\V4pVfR#V\8Xd\VVVR7#V\8Xd
\	WR7#\RV,4h)N)r-rDrR)r,rRz"Unknown value for smartos_type: %s)rTr�r\r>r)�
ValueError)rRrrr�
uname_versions&&&&&rHrUrU�si����*�=�9�����	��	(�/� �"�%�
�	
�

�-�	-�)�(�
�	
��9�L�H�
I�IrJc�(�RRRV.pRp\P!V4wr#\PRW4VfR#VP
4# \Pd/p\P
!\RT,T34Rp?LTRp?ii;i)�filez--briefz--mime-typeNzscript %s mime type is %sz%Failed to identify script type for %s)rr\r]�ProcessExecutionErrorr�logexcrf)ri�cmd�f_type�_errrRs&    rH�
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�"�V'g<\PPV4'd\P!V4V'd<\PP	V4'd\P!V4V'gR#\
P!WVR7V'djVPR4'gS\V4pVR8XdA\
P!VRPRV.4VR7\PRV4V'd�\PP	V4'd\P!V4V'ds\PPV4'dL\
P!\PPV44\P!W4R#R#R#R# \d(p\
P !\RT4Rp?R#Rp?ii;i)	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)rlz#!z
text/plainr	z#!/bin/bashzadded shebang to file %sz$failed establishing content link: %s)r>r?r^�unlink�islinkr�
write_filerfr�r@r\r]�
ensure_dir�dirname�symlink�IOErrorr�)�contentrirjrkrlr�rRs&&&&&  rHrxrx�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+�#$G�G�&$G�A	G�H�'H	�	Hc���\P!4pVf
V^,pVR8Xd\#Vf\P!R4pMTpV'dVPR4'd\#R#)NzBrandZ virtual linuxzsystem-product-name�SmartDC)r>�unamer>r�
read_dmi_datarfr�)r~�product_namer��system_types&&  rHrTrT1se���H�H�J�E����a��
��.�.�#�#����'�'�(=�>��"���{�-�-�i�8�8���rJc��a�R.R&OR.R'OR	R
R./oV'd!\V\\34'gV.pM.pV'd!\V\\34'gV.pM.pV'g.pRpR
pRRVRR/RRVRR//p.pVEF;p\V3RlVP	444p	V	PRRRVR,/4RV9dV	PRVR,/4.p
VP
R.4EF�pVR8XdRR/pEMxVR8XdRR/pEMk.p
\V3RlVP	444pVPRRRV/4V!V4'dRMRpRV9d�VP
RR4'd�Wn,R,'g�VP
R.4Uu.uF"pWn,R,!V4'gK VNK$	pp\V4'd3V^,Wn,R&VPRWn,R,/4VFdp\V3R lVP	444pVPR
VR!,/4V
PV4VPRV
/4Kf	V
PV4EK�	V	PRV
/4VPV	4EK>	V'dVPRR"RVR#V/4R$^R%V/#uupi)(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.
�physical�mac_addressr��subnets�type�subnet�addressr�route�network�gatewayc��RV9#)�.r���addrs&rH�
is_valid_ipv4�3convert_smartos_network_data.<locals>.is_valid_ipv4�����d�{�rJc��RV9#)�:r�r�s&rH�
is_valid_ipv6�3convert_smartos_network_data.<locals>.is_valid_ipv6�r�rJ�ipv4r��gwN�ipv6c3�N<"�TFwrVSR,9gKW3x�K	R#5i)r�Nr���.0rl�v�
valid_keyss&  �rH�	<genexpr>�/convert_smartos_network_data.<locals>.<genexpr>�s&����
�*�t�q�a�:�j�3I�.I�F�Q�F�{���%�%�	interface�mac�ips�dhcp�dhcp4�addrconf�dhcp6c3�N<"�TFwrVSR,9gKW3x�K	R#5i)r�Nr�r�s&  �rHr�r��s&�����'2�t�q�a�:�h�;O�6O�F�Q�F�{�r��static�primaryF�gatewaysc3�N<"�TFwrVSR,9gKW3x�K	R#5i)r�Nr�r�s&  �rHr�r��s+���� �$1�D�A��
�7� 3�3����$1�r��dst�
nameserver�search�version�config)r��mtur��paramsr�r�)	r��	broadcast�dns_nameservers�
dns_search�metric�pointopointr�scoper�)	�
isinstancer�tuple�dictrr�updatersr�r�)r;rrrr�r��pgwsr��nic�cfgr��ipr��	routeents�protor�r�r��rcfgr�s&&&&               @rHr�r�Gs���6	�
�	�

�	���
�)�J�4��+��e�}�5�5�&�-�K������*�t�U�m�4�4�$��J���
������	��-��t�4���-��t�4��D�
�F����
�"�y�y�{�
�
��	�
�
�F�J���K�0@�A�B��C�<��J�J�
�s�5�z�2�3����'�'�%��$�B��V�|� �'�*���z�!� �'�*���	���'*�y�y�{�����
�
���!�2���#0��"3�"3������#����	�5�(A�(A�
 �;�t�,�,�'*�g�g�j�"�&=�$�&=��#�{�7�3�B�7��B�&=�!�$�
�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��
�
����;��*�
�	
�
�q�(�F�+�+��Y$s�0K+�K+c�8�\P!V\4#r�)r�list_from_depends�datasources)�dependss&rH�get_datasource_listr��s���$�$�W�k�:�:rJ�__main__zDo not appear to be on smartos.r�:�NNc��W9d	W!,#V\9d)\V,pVPV4W!&W!,#VR8XdKRFp\WV4K	\VR,VR,VR,VR,R7W!&W!,#V\9d\V,wr5MTRrSVPW5R7W!&W!,#)	r�rrrrr�Fre)rrrr)rtru�load_keyr�rqrs)�clientr�rh�keyname�depkeyrfs&&&   rHr�r�s����;��9���%�%�)�#�.�G�����0�D�I�,�y��+�$�
$������.�
�5�!�.�1� ��/���-��H�~�	�D�I��y��
�(�(�!3�C�!8����"%�u���
�
�7�
�8�D�I��y�rJ)r�r�rh)�indent�	sort_keys�
separatorsc�@�V^8�dQh/^\9d
\;R&#)�rh)�__conditional_annotations__r�)r�s"rH�__annotate__r�s��
�
�R �O�$�O�S rJ)zsdc:uuidT)rT)�root_authorized_keysT)r
F)rF)zcloud-init:user-dataF)rT)rT)�sdc:datacenter_nameT)zsdc:vendor-dataF)zsdc:operator-scriptF)zsdc:hostnameT)zsdc:dns_domainT)rrr�r�zsdc:uuiduser-datar
)NF�r#)NNNN)raz: )Cr�r�r�r�rNr�loggingr>r�r&r1�	cloudinitrrrrr�cloudinit.eventrr	�	getLoggerr�r\rqrtr>r��DS_NAMEr8rr�METADATA_SOCKFILEr��SERIAL_TIMEOUTr9r�ryrwr3r/�	Exceptionr�r�r�r)rBr\rUr�rxrTr��DEP_FILESYSTEMr�r��sys�jmc�print�exitr��argvrrjr�rhr��dumpsr�)r�s@rH�<module>r�s����.�
������	�
�	�
�=�=�1�
����!���%��(��1��)��,��0��2��,��6��-��5��&��*���&�J��?��l�	��"����
���W�%����9���
���"�]��n��*��(��2��%��\�:�.������%��e���
���	�,��f�h��M����8��8�
�D$��*�*�D$�N	�9�	�	�%A�	�l"�l"�^P�!5�P�$G
�!5�G
�TU�'A�U�r�'��!��J�6
6�0H�f�,],�D��/�/�1�2���;��z���
�
�C�
�{�
�/�0������
�3�8�8�}����$�)�)�+�,��%�*�*�,�-�
.�� �
!�	
��x�x��|���<�D�O������4�0��
�$�*�*�T�!�t��
L�M�erJ

Youez - 2016 - github.com/yon3zu
LinuXploit