%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/__pycache__/util.cpython-312.pyc

�

�f�����
�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZ
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZmZddlm Z m!Z!ddl"m#Z#ddlm$Z$m%Z%ddl&m'Z'ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4dd	l5m6Z6dd
l7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBddlCmDZDmEZEe)rddlFmGZGdaHej�eJ�ZKe
j�d
iZMdej�zej�zZPdZQdZRd�ZSe$�d��ZTe$�d��ZUd�de4eVeWfdeVfd�ZXd�de4eVeWfdeWfd�ZYdeWdeWfd�ZZd�Z[Gd�d�Z\Gd�de]�Z^Gd �d!e]�Z_d"�Z`d�d#�Zad�d$�Zbd�d%�Zcd�d&�Zdd�d'�Zedd(�de-fd)�Zfd*�Zgd+�Zhd,�Zid�d.�Zjd/�Zkd0eVdelfd1�Zmd2�Znd-d-dej�d-fd3�Zpe$�d4��Zqe$�d5��Zre$�d6��Zse$�d7��Zte$�d8��Zue$�d9��Zvd�d;�Zwd�d<�Zxd�d=�Zyd�d>�Zze$�d?��Z{d@�Z|e$�dA��Z}d�dB�Z~d�dC�ZdD�Z�d�dE�Z�d�dFe2e0delfdG�Z�ej@dH��Z�ej@dI��Z�dJ�Z�dK�Z�d�dM�Z�d�dN�Z�delffdO�Z�d�dP�Z�dd(�delfdQ�Z�dd(�delfdR�Z�d�dS�Z�d�dT�Z�dU�Z�edVgdW��Z�d�dX�Z�d�dY�Z�de�fdZ�Z�d[�Z�d\�Z�d]�Z�d^�Z�d_�Z�	d�d`�Z�	d�da�Z�	d�db�Z�	d�dc�Z�	d�dd�Z�d�de�Z�df�Z�dd:dg�dhe4eVe
�jBfdie1e+e�gdfdje�deWfdk�Z�dd:dg�dhe4eVe
�jBfdie1e+e�gdfdje�deVfdl�Z�e$�dm��Z�dn�Z�de�fdo�Z�d�dp�Z�d�dq�Z�d�dr�Z�ds�Z�dt�Z�du�Z�d�dveVdeVfdw�Z�dxe
�j^deWfdy�Z�dz�Z�d{�Z�d|�Z�d�d}�Z�elffd~�Z�d�Z�d�d��Z�ej@d���Z�d��Z�				d�d��Z�d��Z�d��Z�d�d��Z�d��Z�d��Zd��Z�e$�d���Z�d��Z�d��Z�	d�d:d��d�e�d�e�ddfd��Z�d��Z�d��Z�d�eVde�fd��Z�d�eVde�fd��Z�d�eVdeVfd��Z�d�eVdeVfd��Z�d�eVde/eVfd��Z�			d�d-ddd��d��Z�d��Z�d�d��Z�d�d��Z�d�d��Z�d��Z�d��Z�d��Z�d��Z�e$�d���Z�d��Z�d�d��Z�d��Z�d��Z�d��Z�eKd:fd��Z�d��Z�d��Z�d��Z�d��Z�d�d��Z�eKd:fd��Z�d�eVde�fd��Z�e3d��Z�			d�d�e+d�e�fde�fd��Z�d��Z�dde
�j�j�fd��Z�d�d��Z�d��Z�d�d��Z�d��Z�d��Z�d��Z�d��Z�d�d��Z�d�d„Z�dÄZ�dĄZ�d�dńZ�d�dƄZ�e%GdDŽd�ed�gdɢ���Z�ddLd:dʜd�eVd�eVd�e1eVd�e�d�e�f
dЄZ�dLdќd�eVd�eVd�e�fd҄Z�d�d�delfdՄZ�e de.de*dffdք�Z�y)��N)�	b64decode)�deque�
namedtuple)�contextmanager�suppress)�ENOENT)�	lru_cache�total_ordering)�Path)�
TYPE_CHECKING�Any�Callable�Deque�Dict�	Generator�List�Mapping�Optional�Sequence�TypeVar�Union)�parse)�features�importer�mergers�net�safeyaml�settings�subp�
temp_utils�
type_utils�
url_helper�version)�CFG_BUILTIN�PER_ONCE)�Paths�_z_-.())�true�1�on�yes)�off�0�no�falsec��ttttj�j
j
d�dd��S)N�.�)�tuple�map�int�os�uname�release�split���0/usr/lib/python3/dist-packages/cloudinit/util.py�kernel_versionr=[s2����S�"�(�(�*�,�,�2�2�3�7���;�<�=�=r;c�h�tjddgd��}|jj�S)z�Return the sanitized string output by `dpkg --print-architecture`.

    N.B. This function is wrapped in functools.lru_cache, so repeated calls
    won't shell out every time.
    �dpkgz--print-architectureT��capture)r�stdout�strip)�outs r<�get_dpkg_architecturerE_s-���)�)�V�3�4�d�
C�C��:�:����r;c�F�ddddd�}i}	tjddgd�	�}|jj�D]2}|jd
�\}}}||vs�|j	�|||<�4|j�D�cgc]	}||vs�|��}}t
|�r%tjddj|��|Scc}w#tj$rA}	tjd
|	�td�|j�D��}Yd}	~	|Sd}	~	wwxYw)N�codename�description�idr8)�Codename�DescriptionzDistributor ID�Release�lsb_releasez--allTr@�:z.Missing fields in lsb_release --all output: %s�,z#Unable to get lsb_release --all: %sc3�$K�|]}|df���
y�w)�UNAVAILABLENr:)�.0�vs  r<�	<genexpr>zlsb_release.<locals>.<genexpr>�s����>�1�Q�
�&�>�s�)rrB�
splitlines�	partitionrC�values�len�LOG�warning�join�ProcessExecutionError�dict)
�fmap�datarD�line�fnamer'�val�k�missing�errs
          r<rMrMjs���$���	�D��D�?��i�i���0�$�?���J�J�)�)�+�	0�D� �N�N�3�/�M�E�1�c���}�$'�I�I�K��T�%�[�!�	0�#�k�k�m�=��q��}�1�=��=��w�<��K�K�@�����!�
��K��>���%�%�?����9�3�?��>����
�>�>���K��	?�s6�AC�*C�	C�C�2C�C�D �6D�D �blob�returnc�J�t|t�r|S|j|��S�N)�encoding)�
isinstance�str�decode)rfrjs  r<�
decode_binaryrn�s!���d�C�(�4�L�d�k�k�8�k�.L�Lr;�textc�J�t|t�r|S|j|��Sri)rk�bytes�encode)rorjs  r<�encode_textrs�s!���d�E�*�4�N����X��0N�Nr;r_c��t|t�stdt|�z��	t	|d��S#t
j$r|cYSwxYw)z�base64 decode data

    If data is base64 encoded bytes, return b64decode(data).
    If not, return data unmodified.

    @param data: data as bytes. TypeError is raised if not bytes.
    zdata is '%s', expected bytesT)�validate)rkrq�	TypeError�typer�binascii�Error)r_s r<�maybe_b64decoderz�sM���d�E�"��6��d��C�D�D�����-�-���>�>�����s�6�A�
Ac���|jd��}|j�dk(rOt|t�r?|j	�}|r|j
r
|j
}nd}|j
|d�S|S)NT)rmro�utf-8�surrogateescape)�get_payload�get_content_maintyperkrq�get_charset�input_codecrm)�part�cte_payload�charsetrjs    r<�fully_decoded_payloadr��sy���"�"�$�"�/�K�� � �"�f�,���U�2��"�"�$���w�*�*��*�*�H��H��!�!�(�,=�>�>��r;c� �eZdZdd�Zd�Zd�Zy)�SeLinuxGuardc��	tjd�|_||_||_y#t$r
d|_Y�!wxYw)N�selinux)r�
import_moduler��ImportError�path�	recursive)�selfr�r�s   r<�__init__zSeLinuxGuard.__init__�sA��	 �#�1�1�)�<�D�L���	�"�����	 ��D�L�	 �s�+�>�>c�R�|jr|jj�ryy�NTF)r��is_selinux_enabled�r�s r<�	__enter__zSeLinuxGuard.__enter__�s���<�<�D�L�L�;�;�=��r;c��|jr|jj�sytjj	|j�sytjj|j�}	tj|�}|jj||tj�tjd||j�	|jj||j��y#t$rYywxYw#t$r,}tjd||j|�Yd}~yd}~wwxYw)Nz,Restoring selinux mode for %s (recursive=%s)�r�z,restorecon failed on %s,%s maybe badness? %s)r�r�r6r��lexists�realpath�lstat�matchpathcon�stat�ST_MODE�OSErrorrY�debugr��
restoreconrZ)r��	excp_type�
excp_value�excp_tracebackr��stats�es       r<�__exit__zSeLinuxGuard.__exit__�s����|�|�4�<�<�#B�#B�#D���w�w���t�y�y�)���w�w����	�	�*��	��H�H�T�N�E��L�L�%�%�d�E�$�,�,�,?�@�	�	�	�:���N�N�	
�
	��L�L�#�#�D�D�N�N�#�C���	��	���	��K�K�>������	
�
��	�s+�<AD� 'D�	D�D�	E� "E�EN�F)�__name__�
__module__�__qualname__r�r�r�r:r;r<r�r��s��#��r;r�c��eZdZy)�MountFailedErrorN�r�r�r�r:r;r<r�r�����r;r�c��eZdZy)�DecompressionErrorNr�r:r;r<r�r��r�r;r�c�X�tj�}|dk(r	||i|��tjd�yt
jd|t
j|��y#t$r<t	t
dt
j|��tjd�YywxYw)Nrz&Failed forking and calling callback %s�z(Forked child %s who will run callback %s)	r6�fork�_exit�	Exception�logexcrYr!�obj_namer�)�child_cb�args�kwargs�fids    r<�fork_cbr��s���
�'�'�)�C�
�a�x�		��d�%�f�%��H�H�Q�K�	�	�	�6������)�	
���	���8��#�#�H�-�
�

�H�H�Q�K�
	�s�A$�$AB)�(B)c��t|t�r|duSt}|rt|�|z}t	|�j�j
�|vryyr�)rk�bool�TRUE_STRINGS�listrl�lowerrC�rb�addons�	check_sets   r<�is_truer�sN���#����d�{���I�
���O�f�,�	�
�3�x�~�~�����9�,��r;c��t|t�r|duSt}|rt|�|z}t	|�j�j
�|vryy)NFT)rkr��
FALSE_STRINGSr�rlr�rCr�s   r<�is_falser�sN���#����e�|���I�
���O�f�,�	�
�3�x�~�~�����9�,��r;c�D�|syt|t�r|St||�S�NF)rkr�r�)rbr�s  r<�translate_boolr�s&�����#����
��3���r;c���tj�}|s!tjtjz}djt
|�D�cgc]}|j|���c}�Scc}w�N�)�random�SystemRandom�string�
ascii_letters�digitsr[�range�choice)�strlen�select_from�r�_xs    r<�rand_strr�!sQ������A���*�*�V�]�]�:��
�7�7�E�&�M�B�b�A�H�H�[�)�B�C�C��Bs�A/c�@�|sd}	td��dz|z}||vr	|S�)Nr��)r�r')r�)�
dictionary�postfix�newkeys   r<�
rand_dict_keyr�(s6�����
���#�c�)�G�3����#���M�	r;��instance_data_filec	��ddlm}m}m}m}	t|�}|rAtjj|�r"	||||�}tjd||�|�iSt|i��S#t$ricYSwxYw#|$r!}tjd||�Yd}~�Cd}~w|$rY�M|$r+}tjd||t|��Yd}~�wd}~wwxYw)z>Read a yaml config with optional template, and convert to dictr)�JinjaLoadError�JinjaSyntaxParsingException�
NotJinjaError�render_jinja_payload_from_filez?Applied instance data in '%s' to configuration loaded from '%s'z4Failed to render templated yaml config file '%s'. %sNz:Could not apply Jinja template '%s' to '%s'. Exception: %s��default)�!cloudinit.handlers.jinja_templater�r�r�r��load_text_file�FileNotFoundErrorr6r��existsrYr�rZ�repr�	load_yaml)rar�r�r�r�r��config_filer�s        r<�	read_confr�2s������$�U�+���b�g�g�n�n�-?�@�	�8���"��K�

�I�I�1�"��	
�0���	��[�"�-�-��I���	��� +�	��K�K�F���
�
��
�	�
��	��K�K� �"���Q��
�
��	�s:�A-�!A>�-A;�:A;�>C�B�C�)C�-!C�Cc�$�tt|��S�N)�sorted�
uniq_merge)�listss r<�uniq_merge_sortedr�hs���*�e�$�%�%r;c���g}|D]T}t|t�r1|j�jd�}|D�cgc]}|s�|��	}}|j	|��Vt|�Scc}w)NrO)rkrlrCr9�extend�	uniq_list)r��
combined_list�a_list�as    r<r�r�tsk���M��%���f�c�"��\�\�^�)�)�#�.�F�!'�-�A�1�a�-�F�-����V�$�%��]�#�#��.s�A'�A'c��tj�D]\}}|j||�}�g}|D]}|tvs�|j	|��|D]}|j|d�}�|j�}|Sr�)�FN_REPLACEMENTS�items�replace�
FN_ALLOWED�appendrC)�fnrcrS�removalss    r<�clean_filenamers����%�%�'����1�
�Z�Z��1�
����H�
����J���O�O�A������
�Z�Z��2�
���	����B�
�Ir;Tc��	tjt|��}tjtjddd|��5}|r"t|j��cddd�S|j�cddd�S#1swYyxYw#t$r#}|r|cYd}~Stt|��|�d}~wwxYw)N�rbr�)�io�BytesIOrs�
contextlib�closing�gzip�GzipFilern�readr�r�rl)r_�quietrm�buf�ghr�s      r<�decomp_gzipr�s���4��j�j��T�*�+��
�
�
��
�
�d�D�!�S� A�
B�	!�b��$�R�W�W�Y�/�	!�	!�
�w�w�y�	!�	!�	!���4���K�$�S��V�,�!�3��	4�sN�A	B�B	�&	B�0B	�?	B�	B�B�B�	C�B<�!C�'B<�<Cc��|sy|jdd�}|dj�}t|�dk(r|dj�}nd}|r|dk(s|j�dk(rd}|r|dk(s|j�dk(rd}||fS)N�NNrNr�rr2z-1�none)r9rCrXr�)�ug_pair�	ug_parted�u�gs    r<�extract_usergroupr�s������
�
�c�1�%�I��!�����A�
�9�~����a�L��� ������T�	�Q�W�W�Y�&�0�����T�	�Q�W�W�Y�&�0���
�q�6�Mr;�root_dirc�h�t�}tjtjj	|d��D]q}tjj|�s�#tjj
|�dd}|j�}|s�X|jd�dk(s�m|||<�s|S)Nz*.pyr���r1���)	r]�globr6r�r[�isfile�basenamerC�find)r�entriesra�modnames    r<�get_modules_from_dirr%�s����f�G����2�7�7�<�<��&�9�:�%���w�w�~�~�e�$���'�'�"�"�5�)�!�B�/���-�-�/���w�|�|�C�(�B�.�$�G�E�N�
%��Nr;c��t|d�5}|j|�|j�ddd�y#1swYyxYw)N�w)�open�write�flush)�conpathro�wfhs   r<�write_to_consoler-�s7��	
�g�s�	��s��	�	�$���	�	�����s	�"8�Ac��|rtjj|�|rUd}d}tjj|�r	t
||�d}|r!|stjj|�|r1|ddk(r|j||dd�y|j||�yy#t$rId}tjj|�d��|r |jtj|�Y��wxYw)Nz/dev/consoleFTzFailed to write to /dev/console�
r)�sys�stderrr)r6r�r�r-r�rB�log�logging�WARNING)	ro�consoler1r2�	log_level�fallback_to_stdoutr+�writing_to_console_worked�
console_errors	         r<�	multi_logr:�s�����
�
������ ��$)�!�
�7�7�>�>�'�"�
<� ��$�/�,0�)��&?�
�J�J���T�"�
���8�t���G�G�I�t�C�R�y�)��G�G�I�t�$�	��)�
<� A�
��
�
� � �M�?�"�!5�6���G�G�G�O�O�]�;��	
<�s�B-�-AC?�>C?c�.�dtj�vS)N�Linux��platform�systemr:r;r<�is_Linuxr@�s���h�o�o�'�'�'r;c�b�dtj�vrytj�dk(ryy)N�BSDT�	DragonFlyFr=r:r;r<�is_BSDrD�s)������!�!������K�'��r;c�"�t�ddk(S)N�variant�freebsd��system_infor:r;r<�
is_FreeBSDrJ�����=��#�y�0�0r;c�"�t�ddk(S)NrF�	dragonflyrHr:r;r<�is_DragonFlyBSDrN�s���=��#�{�2�2r;c�"�t�ddk(S)NrF�netbsdrHr:r;r<�	is_NetBSDrQs���=��#�x�/�/r;c�"�t�ddk(S)NrF�openbsdrHr:r;r<�
is_OpenBSDrTrKr;Fc�*�||vr|St||�Sr�)r���yobj�keyr�s   r<�get_cfg_option_boolrYs��
�$�����$�s�)�$�$r;c�R�||vr|S||}t|t�st|�}|Sr�)rkrl)rWrXr�rbs    r<�get_cfg_option_strr[s/��
�$����
�s�)�C��c�3���#�h���Jr;c�0�tt|||���S)Nr�)r5r[rVs   r<�get_cfg_option_intr]s���!�$��W�=�>�>r;c�l�|sd}tjj|�siSt|�}d}d|vrd}t	j
||�}|rc|j
�}d|dvr|d|d<|dj�jd�d|d<|dd	k(rd
|d<|d|d|dd�SiS)
z�Return a dictionary of distro info fields from /etc/redhat-release.

    Dict keys will align with /etc/os-release keys:
        ID, VERSION_ID, VERSION_CODENAME
    z/etc/redhat-releasezA(?P<name>.+) release (?P<version>[\d\.]+) \((?P<codename>[^)]+)\)�	Virtuozzoz)(?P<name>.+) release (?P<version>[\d\.]+)�namerGz linuxrzred hat enterprise�redhatr#)�ID�
VERSION_ID�VERSION_CODENAME)	r6r�r�r��re�match�	groupdictr�rV)�release_file�redhat_release�redhat_regexrf�groups     r<�_parse_redhat_releaserls����,��
�7�7�>�>�,�'��	�#�L�1�N�	#���n�$�C���H�H�\�>�2�E�����!���%��-�'� %�f�
�E�*���f�
�+�+�-�7�7��A�!�D��f�
���=�0�0�$�E�&�M���-��	�*� %�j� 1�
�	
�
�Ir;c��d}d}d}i}d}tjjd�rtt	d��}|sd}t�}|r�|j
dd�}|j
dd�}d|vsd|vrtj�}n�|d	k(s|d
k(r|j
dd�}ni|dk(r|s|j
dd�}nO|j
d
d�}|s;tjd|j
dd��}|r|j�d}|dk(r�d}nt�r7tj�j�}tj�}n>d}	tj �}d}|D]}|s�d}�	|st$j'd�|S|||fS#t"$rY�7wxYw#d}|D]}|s�d}�	|st$j'd�wwxYw)Nr�F�/etc/os-releaseTrbrc�sles�suse�alpine�photon�PRETTY_NAME�	virtuozzordz[^ ]+ \((?P<codename>[^)]+)\)�VERSIONrG�rhelra)r�r�r�r�zPUnable to determine distribution, template expansion may have unexpected results)r6r�r��load_shell_contentr�rl�getr>�machinererfrgrDr?r�r8�distr�rYrZ)	�distro_name�distro_version�flavor�
os_release�os_release_rhelrfrz�found�entrys	         r<�get_linux_distror�Gs����K��N�
�F��J��O�	�w�w�~�~�'�(�'��7H�(I�J�
����*�,�
�� �n�n�T�2�.��#����b�9���[� �F�k�$9�
�%�%�'�F�
�H�
$��x�(?��^�^�M�2�6�F�
�K�
'���^�^�M�2�6�F��^�^�$6��;�F�����4��N�N�9�b�1����"�_�_�.�z�:�F��&� �"�K�	���o�o�'�-�-�/��!�)�)�+����	��=�=�?�D��E��
����E�
�����<�������0�0���	��	���E��
����E�
�����<���s*�!F!�!	F-�*F0�,F-�-F0�0
G�;Gc��|dj�}d}|dk(r;|ddj�}|dvr|}|S|dvrd}|S|d	k(rd
}|S|dvrd}|Sd}|S|d
vr|}|S)Nr?�unknown�linuxrzr)�	almalinuxrq�arch�centos�
cloudlinux�debian�	eurolinux�fedora�mariner�miraclelinux�	openeuler�opencloudos�openmandrivarrrv�rockyrp�	tencentosrt)�ubuntu�	linuxmint�mintr�rarv)�opensusez
opensuse-leapzopensuse-microoszopensuse-tumbleweed�sle_hpcz	sle-micrororp)�windows�darwinrGrPrSrM)r�)�infor?rF�
linux_dists    r<�_get_variantr��s���
�(�^�
!�
!�
#�F��G�
����&�\�!�_�*�*�,�
��
�
�*!�G�6�N�5�:�
:��G�2�N�1�8�
#��G�.�N�-�
�
��G��N��G��N�
��
����Nr;c�
�tj�tj�tj�tj�t	tj
��t
�d�}t|�|d<|S)N)r>r?r8�pythonr7rzrF)r>r?r8�python_versionr�r7r�r�)r�s r<rIrI�sc���%�%�'��/�/�#��#�#�%��)�)�+��h�n�n�&�'� �"�
�D�#�4�(�D��O��Kr;c��||vr|S||�gS||}t|t�r|D�cgc]}|��}}|St|t�st|�}|gScc}w)a�
    Gets the C{key} config option from C{yobj} as a list of strings. If the
    key is present as a single string it will be returned as a list with one
    string arg.

    @param yobj: The configuration object.
    @param key: The configuration key to get.
    @param default: The default to return if key is not found.
    @return: The configuration option as a list of strings or default if key
        is not found.
    )rkr�rl)rWrXr�rbrS�cvals      r<�get_cfg_option_listr��si���$�����C�y���	�
�s�)�C��#�����a��������c�3���#�h���5�L��	 s�	Ac�t�t|t�r|jd�}|}|D]}||vr|cS||}�|S)a�Return the value of the item at path C{keyp} in C{yobj}.

    example:
      get_cfg_by_path({'a': {'b': {'num': 4}}}, 'a/b/num') == 4
      get_cfg_by_path({'a': {'b': {'num': 4}}}, 'c/d') == None

    @param yobj: A dictionary.
    @param keyp: A path inside yobj.  it can be a '/' delimited string,
                 or an iterable.
    @param default: The default to return if the path does not exist.
    @return: The value of the item at keyp."
        is not found.�/)rkrlr9)rW�keypr��cur�toks     r<�get_cfg_by_pathr��sK���$����z�z�#���
�C�����c�>��N��#�h����Jr;c�@�t||�\}}t||�||fSr�)�get_output_cfg�redirect_output)�cfg�mode�outfmt�errfmts    r<�fixup_outputr��s(��%�c�4�0��V�V��F�F�#��F��r;c��ttjjd��rtjd�y|stj}|stj}d�}|�rtjd||�|jdd�\}}|dk(s|dk(rd	}|dk(rd
}t||�}nG|dk(r4tj|dtj|�
�}	|	j}ntd|z��|r2tj |j#�|j#��||k(rJtjd||�tj |j#�|j#��y|r�tjd||�|jdd�\}}|dk(s|dk(rd	}|dk(rd
}t||�}nG|dk(r4tj|dtj|�
�}	|	j}ntd|z��|r3tj |j#�|j#��yyy)N�_CLOUD_INIT_SAVE_STDOUTz5Not redirecting output due to _CLOUD_INIT_SAVE_STDOUTc��tjd�	tjd�j}tj
|�y#t$rYywxYw)a�Reconfigure umask and group ID to create output files securely.

        This is passed to subprocess.Popen as preexec_fn, so it is executed in
        the context of the newly-created process.  It:

        * sets the umask of the process so created files aren't world-readable
        * if an adm group exists in the system, sets that as the process' GID
          (so that the created file(s) are owned by root:adm)
        ��admN)r6�umask�grp�getgrnam�gr_gid�setgid�KeyError)�group_ids r<�set_subprocess_umask_and_gidz5redirect_output.<locals>.set_subprocess_umask_and_gidsJ��	�����	 ��|�|�E�*�1�1�H�

�I�I�h���	�	��	�s�A�	A�AzRedirecting %s to %s� r��>�>>�ab�wb�|T)�shell�stdin�
preexec_fnz"Invalid type for output format: %sz!Invalid type for error format: %s)r�r6�environrxrYr�r0rBr1r9r(�
subprocess�Popen�PIPEr�rv�dup2�fileno)
r�r��o_out�o_errr�r��arg�owith�new_fp�procs
          r<r�r�s����r�z�z�~�~�7�8�9��	�	�I�J����
�
����
�
�� �&��	�	�(�%��8��l�l�3��*���s��3�;�$�$�,��E��s�{����#�u�%�F�
�S�[��#�#��� �o�o�7�	�D��Z�Z�F��@�6�I�J�J���G�G�F�M�M�O�U�\�\�^�4��V���I�I�,�e�V�<��G�G�F�M�M�O�U�\�\�^�4��
��	�	�(�%��8��l�l�3��*���s��3�;�$�$�,��E��s�{����#�u�%�F�
�S�[��#�#��� �o�o�7�	�D��Z�Z�F��?�&�H�I�I���G�G�F�M�M�O�U�\�\�^�4��'r;�sourcesc���|rtt|��}i}|D]W}|s�tj|�}|stj�}tj
|�}|j
||�}�Y|S)aFMerge multiple dicts according to the dict merger rules.

    Dict merger rules can be found in cloud-init documentation. If no mergers
    have been specified, entries will be recursively added, but no values
    get replaced if they already exist. Functionally, this means that the
    highest priority keys must be specified first.

    Example:
    a = {
        "a": 1,
        "b": 2,
        "c": [1, 2, 3],
        "d": {
            "a": 1,
            "b": 2,
        },
    }

    b = {
        "a": 10,
        "c": [4],
        "d": {
            "a": 3,
            "f": 10,
        },
        "e": 20,
    }

    mergemanydict([a, b]) results in:
    {
        'a': 1,
        'b': 2,
        'c': [1, 2, 3],
        'd': {
            'a': 1,
            'b': 2,
            'f': 10,
        },
        'e': 20,
    }
    )r��reversedr�dict_extract_mergers�default_mergers�	construct�merge)r��reverse�
merged_cfgr��mergers_to_apply�mergers      r<�
mergemanydictr�asz��T��x��(�)���J��7���&�;�;�C�@��#�#*�#:�#:�#<� ��&�&�'7�8�F����j�#�6�J�7��r;c#��K�tj�}	tj|�|��tj|�y#tj|�wxYw�wr�)r6�getcwd�chdir)�ndir�currs  r<r�r��s<����
�9�9�;�D��
������
�
�����������s�A!�A�A!�A�A!c#�K�tj|�}	|��tj|�y#tj|�wxYw�wr�)r6r�)�n_msk�olds  r<r�r��s3����
�(�(�5�/�C���	�
����
������
�s�A
�3�A
�A
�
A
c�,�dj||d|��S)Nz{0:{fill}{align}{size}}�^)�fill�align�size)�format)ror��max_lens   r<�centerr��s#��$�+�+��4�s��,��r;c�Z�tjd|�tj|�y)NzRecursively deleting %s)rYr��shutil�rmtree�r�s r<�del_dirr��s���I�I�'��.�
�M�M�$�r;�c���	t|||�\}}}||d<||d<||d<y#tj$r(}|jtjk(rYd}~y�d}~wwxYw)N�	user-data�vendor-data�	meta-dataTF)�read_seededr"�UrlError�code�	NOT_FOUND)r��base�ext�timeout�md�ud�vdr�s        r<�read_optional_seedr�sj��	�"�4��g�6���R����[�� ��]����[���������6�6�Z�)�)�)��
���s� #�A�A�A�Ac�&�i}|sddg}n^tjj|jd�d�tjj|j	d�d�g}t|�}|D�cgc]'}|s�tjj
|�s�&|��)}}d}|D]a}tjjtjj|d��s�Atjj|d�}nd}|D]a}tjjtjj|d��s�Atjj|d�}n|r|r||d<||d<|S|r||d<|Scc}w)	Nz/var/lib/cloud/data/sslz /var/lib/cloud/instance/data/sslr_�sslzcert.pemzkey.pem�	cert_file�key_file)r6r�r[�
get_ipath_cur�	get_cpathr��isdirr )�paths�ssl_details�ssl_cert_paths�drrs      r<�fetch_ssl_detailsr�s\���K��%�.�
��
�G�G�L�L��,�,�V�4�e�<��G�G�L�L�����0�%�8�
�� ��/�N�!/�J�A�1������q�9I�a�J�N�J��I�
���
�7�7�>�>�"�'�'�,�,�q�*�5�6������Q�
�3�I����H�
���
�7�7�>�>�"�'�'�,�,�q�)�4�5��w�w�|�|�A�y�1�H����X�#,��K� �"*��J����
�#,��K� ����!Ks�7F�?F�Fc���|}t|�}	tjdt|�|�t	j
|�}|�tjd�|}n1t
||�s%td|�dtj|��d���|}|S#tjttf$r�}d}d}t|d�rt|d�r
t|d�}n$t|d�rt|d�rt|d�}|r2|d	j|jd
z|j d
z|��z
}n|dj|�
�z
}tj#|�Yd}~|Sd}~wwxYw)NzKAttempting to load yaml from string of length %s with allowed root types %sz-loaded blob returned None, returning default.zYaml load allows z root types, but got � insteadzFailed loading yaml blob�context_mark�problem_markz5. Invalid format at line {line} column {col}: "{err}"r�)r`�colrez. {err})re)rnrYr�rXr�loadrkrvr!r��	YAMLError�
ValueError�hasattr�getattrr�r`�columnrZ)rfr��allowed�loaded�	convertedr��msg�marks        r<r�r��s`��
�F����D�!��	�	�
6���I��		
��M�M�$�'�	����I�I�E�F��I��I�w�/���J�/�/�	�:�<��
���"�M��!
���	�:�6��(�����1�n�%�'�!�^�*D��1�n�-�D�
�Q��
'�G�A�~�,F��1�n�-�D���G�N�N����Q��D�K�K�!�O��O��
�C�
�9�#�#��#�*�*�C����C����M��!�s�BB�E'�1B+E"�"E'c�j�|jd�dk\r@|jdd|z�}|jdd|z�}|jdd|z�}nWtjr/|ddk7r't	j
|�jdk(r|dz
}|�d�|��}|�d�|��}|�d�|��}tj|||�	�}d}	|j�r tt|j�i�
�}	tj|||�	�}
d}|
j�r|
j}d}	tj|||�	�}
|
j�r
|
j}ntjd�	|	||fS#tj$r }tjd|�Yd}~�3d}~wwxYw)
Nz%srr�r�r�rr�r�)r�retriesr�zError in vendor-data responsez!Error in vendor-data response: %s)r"rr�%NOCLOUD_SEED_URL_APPEND_FORWARD_SLASHr�urlparse�queryr"�read_file_or_url�okr�rn�contentsrYr�r�)r�r�rr"�file_retries�ud_url�vd_url�md_url�md_respr�ud_resprr�vd_respr�s               r<r�r�s����y�y���!�����d�K�#�$5�6�����d�M�C�$7�8�����d�K�#�$5�6���9�9��B�x�3��5�>�>�$�#7�#=�#=��#C�����!�;��4��!�=�#�6��!�;��4���)�)�����G�
�B��z�z�|�
�}�W�%5�%5�6��
C���)�)�����G�
�B��z�z�|�
�
�
��	
�B�
7��-�-��G�W�
���:�:�<��!�!�B��I�I�5�6���B�<������:��	�	�5�q�9�9��:�s�/E?�?F2�F-�-F2c	�n�ttj|�d��}|D�cgc]}|jd�s�|��}}|D�cgc]B}tjjtjj
||��s�A|��D}}g}|D]?}tjj
||�}	|jt||����At|�Scc}wcc}w#t$rtjd|�Y�xt$r!}tjd||�Yd}~��d}~wwxYw)zRead configuration directory.T�r�z.cfgr��1REDACTED config part %s, insufficient permissions�Error accessing file %s: [%s]N)r�r6�listdir�endswithr�r r[rr��PermissionErrorrYrZr�r�)�confdr��confs�f�cfgsrr�r�s        r<�read_conf_dr;<s��
�2�:�:�e�$�d�3�E��4�1����F�!3�Q�4�E�4��H�1�����������U�A�0F�!G�Q�H�E�H��D��B���w�w�|�|�E�2�&��	B��K�K���'9��
�B� �����/
5��
I���	��K�K�C�T�
��	B��K�K�7��q�A�A��	B�s5�C �C �AC%�	C%�7C*�*D4�D4�D/�/D4c��t�}i}	t||��}|j|�d}d|vrU|d}|rut|t�s$td|�dtj|�����t|�j�}n'tjj|�d	��r|�d	�}|r=tjj|�rt!||��}|j#|�t%|�S#t$rtjd|�Y��t$r"}tjd||�Yd}~��d}~wwxYw)
aRead yaml file along with optional ".d" directory, return merged config

    Given a yaml file, load the file as a dictionary. Additionally, if there
    exists a same-named directory with .d extension, read all files from
    that directory in order and return the merged config. The template
    file is optional and will be applied to any applicable jinja file
    in the configs.

    For example, this function can read both /etc/cloud/cloud.cfg and all
    files in /etc/cloud/cloud.cfg.d and merge all configs into a single dict.
    r�r2r3Nr��conf_dzConfig file z( contains 'conf_d' with non-string type z.d)rr�rr6rYrZr�rkrlrvr!r�rCr6r�rr;�
appendleftr�)�cfgfiler�r:r�r�r7�	confd_cfgs       r<�read_conf_with_confdrA\s"����D��C�	���4F�G��	
���C���E��3���H�
����e�S�)���
� 3� 3�E� :�<���
�E�
�(�(�*��	�����'��"�~�	&��)�2���������u�%���:L�M�	����	�"������9�
����?��	
��A����3�W�a�@�@��A�s�
C8�8E�E�!D>�>Ec�,�tt|���S)N��cmdline)r��read_cc_from_cmdlinerCs r<�read_conf_from_cmdlinerF�s���)�'�:�;�;r;c��|�
t�}d|��}d}d}t|�}t|�}t|�}g}|j|�}|dk\r|j|||z�}|dkr|}|jt	j
|||z|j
��jdd��|j|||z�}|dk\r�dj|�S)Nr�z cc:�end_ccrz\nr/)	�get_cmdlinerXr"rr�unquote�lstriprr[)	rD�	tag_begin�tag_end�begin_l�end_l�clen�tokens�begin�ends	         r<rErE�s������-���'��m�G��I��G��)�n�G���L�E��w�<�D�
�F��L�L��#�E�
�1�*��l�l�7�E�G�O�4����7��C��
�
��M�M�'�%�'�/�C�8�?�?�A�B�J�J��t�
�	
�
���Y��e��4���1�*��9�9�V��r;c�l�|jd�}|dks||dz
dk7r|S|jdd�S)Nr/rr��
z
)r"r)r(�poss  r<�dos2unixrW�s?��
�-�-��
�C�
�a�x�8�C�!�G�$��,������F�D�)�)r;�HostnameFqdnInfo)�hostname�fqdn�
is_defaultc�Z�d}d|vr%|d}t|d|jd�d�}ntd|vr4|djd�dkDr|d}|dd|jd�}n<|jd|��j}d|vr|d}n|j|�	�\}}t|||�S)
a�Get hostname and fqdn from config if present and fallback to cloud.

    @param cfg: Dictionary of merged user-data configuration (from init.cfg).
    @param cloud: Cloud instance from init.cloudify().
    @param metadata_only: Boolean, set True to only query cloud meta-data,
        returning None if not present in meta-data.
    @return: a namedtuple of
        <hostname>, <fqdn>, <is_default> (str, str, bool).
        Values can be none when
        metadata_only is True and no cfg or metadata provides hostname info.
        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.
    FrZrYr1rNT)rZ�
metadata_only)r])r[r9r"�get_hostnamerYrX)r��cloudr]r[rZrYs      r<�get_hostname_fqdnr`�s���"�J�
��}��6�{��%�c�:�t�z�z�#��q�7I�J������Z��!5�!5�c�!:�Q�!>��z�?�D��:��'7����3��8�H��%�%���&���h�
��S� ��z�?��',�'9�'9�"/�(:�(�$��*��H�d�J�7�7r;c�"�d}	t|�j�D]^}|jd�}|dk\r|d|}|j�}|s�1|j	�}t|�dkr�P||ddvs�X|d}|S	|S#t$rY|SwxYw)a�
    For each host a single line should be present with
      the following information:

        IP_address canonical_hostname [aliases...]

      Fields of the entry are separated by any number of  blanks  and/or  tab
      characters.  Text  from a "#" character until the end of the line is a
      comment, and is ignored. Host  names  may  contain  only  alphanumeric
      characters, minus signs ("-"), and periods (".").  They must begin with
      an  alphabetic  character  and  end  with  an  alphanumeric  character.
      Optional aliases provide for name changes, alternate spellings, shorter
      hostnames, or generic hostnames (for example, localhost).
    N�#r�r2r�)r�rUr"rCr9rX�IOError)rY�filenamerZr`�hashpos�tokss      r<�get_fqdn_from_hostsrh�s����D�
�"�8�,�7�7�9�	�D��i�i��n�G��!�|��A�g����:�:�<�D���
�:�:�<�D��4�y�1�}���4���8�#��A�w����K�)	�(�K���
���K�
�s�A0B�5B�=B�	B�
Bc	�T�tj|�}|j}t��t	�}d}i}|D]{}	tj|dddt
jt
j�}g||<|D]8\}}	}
}}||j|�d|d���|j|d��:�}|a|rtjd|�	tt �5t#j$|j&j)d��r
	ddd�y	ddd�tj|d�}|ddd}
|
tvS#t
jt
jf$rY��9wxYw#1swY�\xYw#t
jt
jf$rYy	wxYw)
a�determine if a url's network address is resolvable, return a boolean
    This also attempts to be resilent against dns redirection.

    Note, that normal nsswitch resolution is used here.  So in order
    to avoid any utilization of 'search' entries in /etc/resolv.conf
    we have to append '.'.

    The top level 'invalid' domain is invalid per RFC.  And example.com
    should also not exist.  The '__cloud_init_expected_not_found__' entry will
    be resolved inside the search list.
    N)zdoes-not-exist.example.com.zexample.invalid.�!__cloud_init_expected_not_found__rz: zdetected dns redirection: %sz[]T�F)rr$rY�_DNS_REDIRECT_IP�set�socket�getaddrinfo�SOCK_STREAM�AI_CANONNAMEr�add�gaierror�errorrYr�rrr�
is_ip_address�netlocrC)�url�
parsed_urlr`�badips�badnames�
badresults�iname�result�_fam�_stype�_proto�cname�sockaddr�addrs              r<�
is_resolvabler�s�������$�J����D������
��
�
��
	�E�	
��+�+��4��A�v�'9�'9�6�;N�;N���%'�
�5�!�=C�,�9�D�&�&�%���u�%�,�,�����-L�M��J�J�x��{�+�,�
	�"����I�I�4�j�A�
�
�j�
!�	�� � ��!2�!2�!8�!8��!>�?��	�	�?�	��#�#�D�$�/���a�y��|�A����+�+�+���O�O�V�\�\�2�
��
��	�	��
�O�O�V�\�\�*����sB�A8E�F� 0E5�F�0F�#E2�1E2�5E>�:F�#F'�&F'c�.�tj�}|Sr�)rn�gethostname)rYs r<r^r^Gs���!�!�#�H��Or;c�f�	tj|�dS#tj$rYywxYw�Nr)rn�
gethostbyaddr�herror)�ips r<r�r�Ls3����#�#�B�'��*�*���=�=����s��0�0c�L�ttjd|zt|f��S)z5determine if this url is resolvable (existing or ip).zResolving URL: )�logfuncr�funcr�)�log_timerYr�r�)rws r<�is_resolvable_urlr�Ss&����	�	���#�
��V�	�r;c��|�ytjd|�|D](}	t|�rtjd|�|cS�*y#t$rY�7wxYw)zc
    Search through a list of mirror urls for one that works
    This needs to return quickly.
    Nz%search for mirror in candidates: '%s'zfound working mirror: '%s')rYr�r�r�)�
candidates�cands  r<�search_for_mirrorr�]sj��
����I�I�5�z�B����	� ��&��	�	�6��=���'�����	��	�s�"A�	A�Ac�2�ttjjd��ryt	tj
�5}tj|j�tjj��ddd�y#1swYyxYw)z�
    reopen stdin as /dev/null so even subprocesses or other os level things get
    /dev/null as input.

    if _CLOUD_INIT_SAVE_STDIN is set in environment to a non empty and true
    value then input will not be closed (useful for debugging).
    �_CLOUD_INIT_SAVE_STDINN)
r�r6r�rxr(�devnullr�r�r0r�)�fps r<�close_stdinr�psa���r�z�z�~�~�6�7�8��	
�b�j�j�	�1�R�
����	�	��S�Y�Y�-�-�/�0�1�1�1�s
�AB
�
Bc��g}|s+tjd�tjd�zS|jd�rI|jd�}d|zd|zfD�cgc]#}tjj|�r|��%}}|S|dk(rtjd�}|S|dk(rtjd�}|Scc}w)Nz/dev/msdosfs/*z/dev/iso9660/*�LABEL=z
/dev/msdosfs/z
/dev/iso9660/�	TYPE=vfat�TYPE=iso9660)r�
startswithrKr6r�r�)�criteria�oformat�tag�no_cacher��devlist�label�ps        r<�find_devs_with_freebsdr�~s����G���y�y�)�*�T�Y�Y�7G�-H�H�H����8�$�����)��&��-���/F�G�
���w�w�~�~�a� �
�
��
��N�	
�[�	 ��)�)�,�-���N�
�^�	#��)�)�,�-���N��
s�(Cc��g}d}d}d}|rD|jd�r|jd�}|jd�r|jd�}tjgd�dg��}	|	jj	�D]V}
|s|rtjd|
gddg��\}}|rd	|z|vr�/|d
k(rd|vr�9|dk(rd|vr�C|jd
|
z��X|S)Nr�r�zTYPE=��sysctl�-nzhw.disknamesr��rcs�	mscdlabelr�z
label "%s"�iso9660zISO filesystem�vfat�/dev/)r�rKrrBr9r)r�r�r�r�r�r�r��_type�
mscdlabel_outrD�devr's            r<�find_devs_with_netbsdr��s����G��E��E��M�����x�(��O�O�H�-�E����w�'��O�O�G�,�E�
�)�)�4�1�#�
>�C��z�z���!�	&���E�#�y�y�+�s�);�!�Q��H��M�1��l�U�*�=�@���I��"2�-�"G���F�?�/�=�@�����w��}�%�	&��Nr;c�v�tjgd�dg��}g}|jj�jd�D]Z}|j	d�s�|dk(r�|j|dddz�|j
d	�r�D|j|ddd
z��\|D�cgc]}d|z��	c}Scc}w)Nr�rr�rOrNzfd0:rr��cd�ir�)rrB�rstripr9r5rr�)	r�r�r�r�r�rDr�r�r�s	         r<�find_devs_with_openbsdr��s����)�)�4�1�#�
>�C��G����"�"�$�*�*�3�/�-���~�~�c�"���F�?�����u�S�b�z�C�'�(�����%��N�N�5��"�:��+�,�-�")�)�A�G�a�K�)�)��)s�'B6c��tjgd�dg��}t|jj�d��D�cgc]&}|j	d�s|j	d�s|��(}}|dk(r"|D�cgc]}|j	d	�s�|��}}n>|d
vr"|D�cgc]}|j	d	�r�|��}}n|rt
j
d|�|D�cgc]}d|z��	c}Scc}wcc}wcc}wcc}w)
N)r�r�z
kern.disksrr�Tr1r�vnr�)r��acd)zLABEL=CONFIG-2r�zUnexpected criteria: %sr�)rr�rBr9r�rYr�)r�r�r�r�r�rDr�r�s        r<�find_devs_with_dragonflybsdr��s����)�)�2���
<�C���
�
�(�(�*�D�9��
��|�|�D�!�!�,�,�t�*<�	
��G���>�!�%�E�����m�)D�1�E��E�	�4�	4�%�K��a�l�l�=�.I�1�K��K�	��	�	�+�X�6�!(�)�A�G�a�K�)�)����F��K��*s$�+C'�8C,�C,�C1�5C1�C6c���t�rt|||||�St�rt|||||�St	�rt|||||�St
�rt|||||�Sdg}g}|r|jd|z�|r|jd|z�|r|jddg�|r|jd|z�|r|j|�||z}	tj|ddg�	�\}}	g}|j�D]&}|j�}|s�|j|��(|S#tj$r!}
|
jtk(rd
}n�Yd}
~
�ld}
~
wwxYw)z�
    find devices matching given criteria (via blkid)
    criteria can be *one* of:
      TYPE=<filesystem>
      LABEL=<label>
      UUID=<uuid>
    �blkidz-t%sz-s%s�-c�	/dev/nullz-o%srr2r�r�N)rJr�rQr�rTr�rNr�rr�rr\�errnorrUrC)
r�r�r�r�r��
blk_id_cmd�options�cmdrD�_errr�r#r`s
             r<�find_devs_withr��sr���|�%�h���h��M�M�	��$�X�w��X�t�L�L�	��%�h���h��M�M�	�	�*��g�s�H�d�
�	
���J��G��	���v��*�+�
����v��~�&��	����k�*�+��	���v��)�*�����t��
�w�
�C���i�i��!�Q��0���d��G���� �!���z�z�|����N�N�4� �!��N���%�%���7�7�f���C��
���s�D3�3E'�E"�"E'c�B�|�g}nt|�}gd�}|r|jddg�|j|�tj|dd��}i}|jj	�D]-}|jd�\}}}t
|�||<|||d<�/|S)	z�Get all device tags details from blkid.

    @param devs: Optional list of device paths you wish to query.
    @param disable_cache: Bool, set True to start with clean cache.

    @return: Dict of key value pairs of info for the device.
    )r��-o�fullr�r�Tr)rArmrN�DEVNAME)r�r�rrBrUrVrw)	�devs�
disable_cacher�rD�retr`r�r'r_s	         r<r�r�s����|����D�z��
!�C���
�
�D�+�&�'��J�J�t��
�)�)�C��i�
8�C�
�C��
�
�%�%�'�"���~�~�c�*���Q��%�d�+��C��!��C����"�
�Jr;c�D�g}|D]}||vr�|j|��|Sr�)r)�in_list�out_listr�s   r<r�r�/s3���H�
�����=���O�O�A��	�
�Or;��read_cbrrar�rc�@�tjd||�tj�}	t	|d�5}t|||��ddd�|j�}tjdt|�|�|S#1swY�;xYw#t$r|s�Y�LwxYw)NzReading from %s (quiet=%s)r)�chunk_cbzRead %s bytes from %s)	rYr�rr	r(�pipe_in_outr��getvaluerX)rar�r�ofh�ifhr(s      r<�load_binary_filer�9s����I�I�*�E�5�9�
�*�*�,�C��
�%��
�	4�#���S�7�3�	4�
�|�|�~�H��I�I�%�s�8�}�e�<��O�	4�	4��������s(�B�B�B�B�B�B�Bc�0�tt|||���S)Nr�)rnr�)rar�rs   r<r�r�Ls���)�%���N�O�Or;c��t�r#	td�}|jdd�dd}|S	td�j
�}|S#t$r#}tjd|�d}Yd}~|Sd}~wwxYw#t$rd}Y|SwxYw)Nz/proc/1/cmdline�r�rz"failed reading /proc/1/cmdline: %sr�z
/proc/cmdline)�is_containerr�rr�rYrZrC)r(rDr�s   r<�_get_cmdliner�Us����~�	�%�&7�8�H��&�&�v�s�3�C�R�8�G��N�	�$�_�5�;�;�=�G��N���	��K�K�<�a�@��G��N��	���	��G��N�	�s(� A
�A9�
	A6�A1�1A6�9B�Bc�`�dtjvrtjdSt�S)N�DEBUG_PROC_CMDLINE)r6r�r�r:r;r<rIrIhs&���r�z�z�)��z�z�.�/�/��>�r;c�n�d}	t|�j�}|dk(S#ttf$rYywxYw)Nz/proc/sys/crypto/fips_enabledr)F)r�rCrdr�)�	fips_procr(s  r<�fips_enabledr�osB��/�I��!�)�,�2�2�4���3�����W����	�s�"�4�4c��d}	|j|�}t|�dk(rn*|j|�|t|�z
}|r||��J|j�|Sr�)rrXr)r*)�in_fh�out_fh�
chunk_sizer��bytes_pipedr_s      r<r�r�{sa���K�
��z�z�*�%���t�9��>���L�L����3�t�9�$�K����%���L�L�N��r;c�t�|dvr|dvrytjd|||�tj|||�y)N)Nrz%Changing the ownership of %s to %s:%s)rYr�r6�chown)ra�uid�gids   r<�	chownbyidr��s7��
�j��S�J�.���I�I�5�u�c�3�G��H�H�U�C��r;c���d}d}	|rtj|�j}|rtj|�j
}t|||�y#t$r}td|z�|�d}~wwxYw)NrzUnknown user or group: %s)	�pwd�getpwnam�pw_uidr�r�r�r�r�r�)ra�userrkr�r�r�s      r<�chownbynamer��su��
�C�
�C�@���,�,�t�$�+�+�C���,�,�u�%�,�,�C��e�S�#����@��1�Q�7�8�a�?��@�s�AA�	A3�A.�.A3c��ddg}|rd|vr|S|d}||vr||}nd|vr|S|d}t|t�r||g}t|t�r,t|�dkDr|d|d<t|�dkDr|d|d<t|t�rd|vr|d|d<d|vr|d|d<|ddk(r|d|d<gd�}tt|��D]v}||s�	||j
�}d}|D]8}	|j|	�s�|	�d	|t|	�dj���}d
}n|sd�d	|j���}|||<�x|S)N�output�allrr�rtz&1)r�r�r�Fr�Tr�)	rkrlr�rXr]r�rKr�rC)
r�r�r��outcfg�modecfg�swlistr�rbr��ss
          r<r�r��s�����,�C��(�#�%��
�
��]�F��v�~���,������J���-���'�3���� ���'�4� ��w�<�!���Q�Z�C��F��w�<�!���Q�Z�C��F��'�4� ��w���X�&�C��F��g���W�%�C��F��1�v��~��Q���A��
�F�
�3�s�8�_�
���1�v���!�f�m�m�o�����	�A��~�~�a� �!"�C��A���M�$7�$7�$9�:�����		�
�!�3�9�9�;�/�C���A��
��Jr;c�x�g}g}|rt|t�s|S|jd�}|r|j|�t	|d�D]~}|s�tjd|�}|s�|jd�}|j�}t|�dk(r|j|��`ddg|ddk(s�k|j|d���|D]V}tj|�d	��D]9}	tjj|	�s�#|	|k7s�)|j|	��;�Xtt||z��S)
z�Return a list of log file paths from the configuration dictionary.

    @param cfg: The cloud-init merged configuration dictionary.
    �def_log_fileNz (?P<type>\||>+)\s*(?P<target>.*)�targetr��teez-ar2�*)rkr]rxrr�rerfrkr9rXrr6r�r r�rm)
r��logs�rotated_logs�default_log�fmtrfr��parts�logfile�rotated_logfiles
          r<�get_config_logfilesr�s.��
�D��L��j��d�+����'�'�.�)�K�����K� ��c�4�(�"�������<�c�B�������X�&��������u�:��?��K�K����T�]�e�B�Q�i�
'��K�K��a��!�"��5��#�y�y�G�9�A��7�	5�O��w�w�~�~�o�.�?�g�3M��#�#�O�4�		5�5���D�<�'�(�)�)r;c��|r|j|g|���tj�}|dk(rd}|j|g|��d|i�y)N�NNN�exc_info)rZr0rr�)r2rr�rs    r<r�r�sM��
�����C��$���|�|�~�H��%�%���
�C�I�I�c�,�t�,�H�,r;�routinec��tj|�}|jt|��|j	�}|�|d|S|Sr�)�hashlib�new�updaters�	hexdigest)rfr�mlen�hasher�digests     r<�	hash_blobrsF��
�[�[��
!�F�
�M�M�+�d�#�$�
�
�
�
�F����a��~���
r;r9c���tj�}t�fd�d�D]}|j|��|j	�S)z�Hash the content of a binary buffer using SHA1.

    @param f: buffered binary stream to hash.
    @return: digested data as bytes.
    c�B���jtj�Sr�)rr�DEFAULT_BUFFER_SIZE)r9s�r<�<lambda>zhash_buffer.<locals>.<lambda>*s���a�f�f�R�%;�%;�<�r;r;)r�sha1�iterrr)r9r�chunks`  r<�hash_bufferr#s?����\�\�^�F��<�c�B����
�
�e����=�=�?�r;c�P�	tj|�ryy#t$rYywxYwr�)r�r�r��r`s r<�is_userr /�-����<�<�������������	%�%c�P�	tj|�ryy#t$rYywxYwr�)r�r�r�rs r<�is_groupr$7r!r"c�^�tjd||�tj||�y)NzRenaming %s to %s)rYr�r6�rename��src�dests  r<r&r&?s!���I�I�!�3��-��I�I�c�4�r;c�*�|D]}t||��yr�)�
ensure_dir)�dirlistr�rs   r<�ensure_dirsr-Es��
����1�d��r;c��tjt|��}t|t	|��sCdj|D�cgc]
}t
|���c}�}td|�dt|��d���|Scc}w)N�, �(z) root types expected, got r)	�json�loadsrnrkr3r[rlrvrw)ro�
root_types�decoded�t�expected_typess     r<�	load_jsonr7Jsi���j�j��t�,�-�G��g�u�Z�0�1����J�#?�q�C��F�#?�@����t�G�}�
.�
�	
��N��$@s�A9c���tjj|�}|tjj|�k(r|Stjj|�r|St	|�S)z�Get the last directory in a path that does not exist.

    Example: when path=/usr/a/b and /usr/a does not exis but /usr does,
    return /usr/a
    )r6r��dirnamer�get_non_exist_parent_dir)r��p_paths  r<r:r:UsP���W�W�_�_�T�
"�F�
�������(�(���
�7�7�=�=�� ��K�+�F�3�3r;c�
�tjj|�s�t|�}t	tjj|�d��5tj|�ddd�t||�|s|rht|||�t|j|�ddd�}t|�}|jD] }|j|�}t|||��"yyt||�y#1swY��xYw)NTr�r�)
r6r�rr:r�r9�makedirs�chmodr�rr9r�joinpath)r�r�r�rk�non_existed_parent_dir�sub_relative_dir�sub_pathr�s        r<r+r+fs���
�7�7�=�=���!9�$�!?��
�"�'�'�/�/�$�/�4�
@�	��K�K���	�
�d�D���5��.��e�<� $�D�J�J�/E�$F�q�$I�!�"�$M�N���2�3�H�(�.�.�
3��#�,�,�T�2���H�d�E�2�
3�
�	�d�D��	�	�s�C9�9Dc#�K�	|��|rd|g}tj|�yy#|rd|g}tj|�wwxYw�w)N�umount)r)rD�
umount_cmds  r<�	unmounterrF}sL����"����"�F�+�J��I�I�j�!���6�"�F�+�J��I�I�j�!��s�A�%�A�A�Ac��i}	tjjd�rtd�j	�}d}n1tj
d�}|jj	�}d}d}|D]�}	|dk(r|j�\}}}}	}
}nZtj||�}|jd�}|jd�}|jd�}|jd�}	|jd	d
�}|||	d�||<��tjd||�|S#t$rY��wxYw#tt f$rt#td
�Y|SwxYw)Nz/proc/mountsr��mountz*^(/dev/[\S]+) on (/.*) \((.+), .+, (.+)\)$r�r2rcrkz\040r�)�fstype�
mountpoint�optszFetched %s mounts from %szFailed fetching mount points)r6r�r�r�rUrrBr9re�searchrkr�rrYr�rdr�r�)
�mounted�
mount_locs�methodrD�mountre�mpliner��mprIrK�_freq�_passno�ms
             r<�mountsrV�sO���G�"4�
�7�7�>�>�.�)�'��7�B�B�D�J��F��)�)�G�$�C����.�.�0�J��F�?�� �	�F�

��V�#�>D�l�l�n�;�S�"�f�d�E�7��	�	�'�6�2�A��'�'�!�*�C������B��W�W�Q�Z�F��7�7�1�:�D�
���G�S�)�B� � ���G�C�L�#	�,	�	�	�-�w��?��N���
��
��
�W��4��s�2�3��N�4�s7�A3D4�8A7D%�/4D4�%	D1�.D4�0D1�1D4�4E�Ec��t|t�r|g}nKt|ttf�rt|�}n)|�d}n$t	djt
|�����t�r|�?dg}n;t�r.|�gd�}t|�D]\}}|dk(rd||<|dvs�d	||<�nd
g}t�}tj�5}	d}
tjj|�|vr&|tjj|�d}nyd}|D]\}d}	gd
�}
|r|
j!d|g�|
j#|�|
j#|	�t%j$|
|��|	}
|	}nst1d|�d|	�d|����|j3d�s|dz
}t5|
�5|�	||�}n	|||�}|cddd�cddd�S#t&t(f$r6}|r(t*j-d||dj/
�|�|}Yd}~��d}~wwxYw#1swYnxYw	ddd�y#1swYyxYw)a2
    Mount the device, call method 'callback' passing the directory
    in which it was mounted, then unmount.  Return whatever 'callback'
    returned.  If data != None, also pass data to callback.

    mtype is a filesystem type.  it may be a list, string (a single fsname)
    or a list of fsnames.
    Nz6Unsupported type provided for mtype parameter: {_type})r��auto)�ufs�cd9660�msdosr�rZ)r��msdosfsr[r�FrJ)rHr��roz-t)�
update_envzbFailed to mount device: '%s' with type: '%s' using mount command: '%s', which caused exception: %sr�zFailed mounting z to z	 due to: r�)rkrlr�r3rvr�rwr@rD�	enumeraterVr �tempdirr6r�r�r�rrrdr�rYr�r[r�r5rF)�device�callbackr_�mtype�update_env_for_mount�	log_error�mtypes�indexrM�tmpdrDrJ�failure_reason�mountcmd�excr�s                r<�mount_cbrl�sd��"�%������	�E�D�%�=�	)��e���	�����D�K�K��5�k�
L�
�
�	
��z��>��X�F�	���>�/�F�%�f�-�	(�L�E�5��	�!� (��u�
��+�+� '��u�
�		(�����h�G�	�	�	�	�,����
�7�7���F�#�w�.� ����!1�!1�&�!9�:�<�H�J�!�N��
)��!�
�)�4�H�� ����u�
�6��O�O�F�+��O�O�D�)��I�I�h�3G�H�!�F�!%�J��
)�0�&��t�^�5����"�"�3�'��#��J�
�v�
�	��|��z�*���z�4�0���	�	�O,�,��$ ��)�)� ��	�	�9�#�!��H�H�X�.���&)�N��)��*	�	��	�O,�,�,�sP�	AH4�AG�3:H4�-H�	H4�H�%,H�H4�H�H4�H'	�#H4�4H=c�4�tjt�Sr�)�obj_copy�deepcopyr$r:r;r<�get_builtin_cfgrp
s�����[�)�)r;c�l�tjd|�tjj	|�S)NzTesting if a link exists for %s)rYr�r6r��islinkr�s r<�is_linkrss$���I�I�/��6�
�7�7�>�>�$��r;c��tjd||�|r�tjj	|�rvtjjtjj
|�dtd�z�}tj||�tj||�ytj||�y)Nz$Creating symbolic link from %r => %r�tmpr�)
rYr�r6r�r�r[r9r��symlinkr)�source�link�force�tmp_links    r<�sym_linkr{s~���I�I�4�d�F�C��������&��7�7�<�<������� 5�u�x��{�7J�K��
�
�
�6�8�$�
�
�
�8�T�"���J�J�v�t�r;c�z�tjd|�	tj|�y#t$rYywxYw)NzAttempting to remove %s)rYr�r6�unlinkr�r�s r<�del_filer~#s3���I�I�'��.�
�
�	�	�$����
��
�s�.�	:�:c�^�tjd||�tj||�y)NzCopying %s to %s)rYr�r��copyr's  r<r�r�+s!���I�I� �#�t�,�
�K�K��T�r;c�|�	tjdtj��}|S#t$rd}Y|SwxYw)Nz%a, %d %b %Y %H:%M:%S %z�??)�time�strftime�gmtimer�)�tss r<�time_rfc2822r�0s@���
�]�]�5�t�{�{�}�
E���I����
��
�I��s�(,�;�;c� ��ddl�ddl�G�fd�d�j�}�j�jjd��}�j
�}�j|�|_dt�sdndg}�jd	z|�}|�}|j|�jt|���j|��j|�dd�d
k7r|j|jdzzSt!d��)
a�Use sysctl(3) via ctypes to find kern.boottime

    kern.boottime is of type struct timeval. Here we create a
    private class to easier unpack it.
    Use sysctl(3) (or sysctl(2) on OpenBSD) because sysctlbyname(3) does not
    exist on OpenBSD. That complicates retrieval on NetBSD, which #defines
    KERN_BOOTTIME as 83 instead of 21.
    21 on NetBSD is KERN_OBOOTTIME, the kern.boottime up until NetBSD 5.0

    @return boottime: float to be compatible with linux
    rNc�J��eZdZdW�jfdW�jfgZy)�boottime.<locals>.timeval�tv_sec�tv_usecN)r�r�r��c_int64�_fields_)�ctypess�r<�timevalr�Hs����v�~�~�.��F�N�N�0K�L�r;r��cr���Sr2rg��.Az/Unable to retrieve kern.boottime on this system)r��ctypes.util�	Structure�CDLL�util�find_library�c_size_t�sizeof�valuerQ�c_intr�rX�byrefr�r��RuntimeError)r��libcr��
mib_values�mibrr�s      @r<�boottimer�8s������M�&�"�"�M��;�;�v�{�{�/�/��4�5�D��?�?��D����w�'�D�J�	��+��2��J��6�<�<�!��j�
)�C�
�)�C������L�L��Z��)��L�L����L�L����
�
	
��	��z�z�C�K�K�)�3�3�3�
�H�
I�Ir;c�2�d}d}	tjjd�r%d}td�}|r@|j	�d}	|Sd}tt
j�t�z
�}|S#t$rttd|z�Y|SwxYw)Nr�r�z/proc/uptimerr�z&Unable to read uptime using method: %s)r6r�r�r�r9rlr�r�r�r�rY)�
uptime_strrOr(s   r<�uptimer�cs����J�
�F�G�
�7�7�>�>�.�)�#�F�%�n�5�H��%�^�^�-�a�0�
���
�F��T�Y�Y�[�8�:�5�6�J�����G��s�<�v�E�F���G�s�AA6�
*A6�6B�Bc�"�t||dd��y)Nr�)�omoder���
write_file)r��contents  r<�append_filer�vs���t�W�D�t�4r;)�
preserve_moder�r�c�$�t|dd||��y)Nr�r�)r�r�r�r�r�)r�r�r�s   r<�ensure_filer�zs����b��4�}�r;c�D�	t|�S#ttf$rYywxYwr�)r5rrv)�possible_ints r<�safe_intr��s)����<� � ���	�"����s�

��c��t|�}|r.|r+t|�5tj||�ddd�yyy#1swYyxYwr�)r�r�r6r>)r�r��	real_modes   r<r>r>�sG�����I��	�
�$�
�	&��H�H�T�9�%�	&�	&��t�	&�	&�s	�=�A�grp_namec��d}	tj|�j}|S#t$rtjd|�Y|SwxYw)zt
    Returns the group id of a group name, or -1 if no group exists

    @param grp_name: the name of the group
    rz"Group %s is not a valid group name)r�r�r�r�rYr�)r�r�s  r<�get_group_idr��sQ��
�C�B��l�l�8�$�+�+���J���B��	�	�6��A��J�B�s�%�A�Ar�c�f�tjtj|�j�S)z�
    Returns the octal permissions of the file/folder pointed by the path,
    encoded as an int.

    @param path: The full path of the file/folder.
    )r��S_IMODEr6�st_moder�s r<�get_permissionsr��s!���<�<�����
�-�-�.�.r;c�~�tj|�}tj|j�j
S)zw
    Returns the owner of the file/folder pointed by the path.

    @param path: The full path of the file/folder.
    )r6r�r��getpwuid�st_uid�pw_name�r��sts  r<�	get_ownerr���*��
�����B��<�<��	�	�"�*�*�*r;c�~�tj|�}tj|j�j
S)zw
    Returns the group of the file/folder pointed by the path.

    @param path: The full path of the file/folder.
    )r6r�r��getgrgid�st_gid�gr_namer�s  r<�	get_groupr��r�r;�usernamec�*�g}tj�D],}||jvs�|j|j��.tj|�j}|jtj|�j�|S)zp
    Returns a list of all groups to which the user belongs

    @param username: the user we want to check
    )	r��getgrall�gr_memrr�r�r��pw_gidr�)r��groupsrkr�s    r<�get_user_groupsr��sp���F�����)���u�|�|�#��M�M�%�-�-�(�)��,�,�x�
 �
'�
'�C�
�M�M�#�,�,�s�#�+�+�,��Mr;)�ensure_dir_existsr�rkc	�J�|r	t|�}|r+ttjj|�||��d|j
�vrt|�}d}n
t|�}d}	d|z}	tjd|||	t|�|�t|��5t||�5}
|
j|�|
j!�d	d	d	�d	d	d	�t#||�y	#t$rY��wxYw#t$rd|z}	Y��wxYw#1swY�AxYw#1swY�ExYw)
a)
    Writes a file with the given content and sets the file mode as specified.
    Restores the SELinux context if possible.

    @param filename: The full path of the file to write.
    @param content: The content to write to the file.
    @param mode: The filesystem mode to set on the file.
    @param omode: The open mode used when opening the file (w, wb, a, etc.)
    @param preserve_mode: If True and `filename` exists, preserve `filename`s
                          current mode instead of applying `mode`.
    @param ensure_dir_exists: If True (the default), ensure that the directory
                              containing `filename` exists before writing to
                              the file.
    @param user: The user to set on the file.
    @param group: The group to set on the file.
    )r�rk�brq�
charactersz%oz%rzWriting to %s - %s: [%s] %s %sr�N)r�r�r+r6r�r9r�rsrnrvrYr�rXr�r(r)r*r>)rer�r�r�r�r�r�rk�
write_type�mode_r�fhs           r<r�r��s ��8�	�"�8�,�D���2�7�7�?�?�8�,�4�u�E�
�e�k�k�m���g�&���
���(��!�
�������I�I�(��
���G���
�
�8�	$��
�(�E�
"�	�b��H�H�W���H�H�J�	��
�(�D���7�	��	����������	�	����sG�C*�*C9�
D�+"D
�
D�*	C6�5C6�9D
�	D
�
D	�D�D"c���tj|�D]X}tjj||�}tjj	|�rt|��Nt
|��Zy)z�
    Deletes all contents of a directory without deleting the directory itself.

    @param dirname: The directory whose contents should be deleted.
    N)r6r4r�r[rr�r~)r9�node�
node_fullpaths   r<�delete_dir_contentsr�
	sP���
�
�7�#�$�������W�d�3�
�
�7�7�=�=��'��M�"��]�#�$r;c��tj�}t|�}|d|j��d|��z
}|dt	�zz
}|S)Nr�z by cloud-init v. z on %s)r#�version_stringrl�titler�)�comment_charr��ci_ver�headers    r<�make_headerr�	sE��
�
#�
#�
%�F�
��
�F�
�4�:�:�<��@�@�F�
�h���'�'�F��Mr;c	�$�t|ttf�s!tdt	j
|�z��d}|r|dz
}ddz}d}|D]�}t|ttf�rRg}|D]/}|j
dt|�jd|�z��1|�d	j|��d
�}|dz
}�kt|t�r
|�|�d
�}|dz
}��|���tdt	j
|��d
|����tjd|�|S)Nz8Input to shellify was type '%s'. Expected list or tuple.r�z
#!/bin/sh
z%s%s%s%s)�'�\r�r�rz'%s'r�r�r/r�zUnable to shellify type 'z&'. Expected list, string, tuple. Got: zShellified %s commands.)rkr3r�rvr!r�rrlrr[rYr�)�cmdlist�
add_headerr��escaped�	cmds_mader��fixedr9s        r<�shellifyr�$	s$���g��t�}�-��F��"�"�7�+�
-�
�	
�
�G���=� ���0�0�G��I�����d�T�5�M�*��E��
F�����V�s�1�v�~�~�c�7�'C�D�E�
F�")�3�8�8�E�?�;�G���N�I�
��c�
"�")�4�0�G���N�I�
�\���'�0�0��6��>��
�!�*�I�I�'��3��Nr;c��|r|j|�r|t|�d}|r |j|�r|dt|�}|Sr�)r�rXr5)r`�prefix�suffixs   r<�strip_prefix_suffixr�I	sE��
�$�/�/�&�)��C��K�M�"��
�$�-�-��'��N�s�6�{�l�#���Kr;c��tj|d��y	tj|�y#tj$rYywxYw)NrFT)r�whichr\)r�s r<�_cmd_exits_zeror�Q	sG���z�z�#�a�&��!����	�	�#�����%�%����s�1�A�Ac��tgd��S)N)zsystemd-detect-virtz--quietz--container�r�r:r;r<�_is_container_systemdr�[	s���L�M�Mr;c��tdg�S)Nzlxc-is-containerr�r:r;r<�_is_container_old_lxcr�_	s���.�/�0�0r;c��t�sygd�}tj|d��ytj|�\}}|j�dk(S)NF)r�z-qnzsecurity.jail.jailedrr))rJrr�rC)r�rDr's   r<�_is_container_freebsdr�c	sG���<��
3�C��z�z�#�a�&��!��
�Y�Y�s�^�F�C���9�9�;�#��r;c��tttf}|D]}|�s�y	td�}d|vryd|vry	tjjd�r tjjd�sy	td�j�}|D]>}|jd�s�|j�jd	d�\}}|d
k7s�>y	y#tt
f$rY��wxYw#tt
f$rYywxYw)zH
    Checks to see if this code running in a container of some sort
    Tr��	container�LIBVIRT_LXC_UUIDz/proc/vzz/proc/bcz/proc/self/statuszVxID:rNr-F)r�r�r��get_proc_envrdr�r6r�rr�rUr�rCr9)�checks�helper�pid1env�linesr`�_keyrbs       r<r�r�m	s��	����F�����8���	
��q�/���'�!����(��)�
�w�w�}�}�Z� ������z�)B��	
��2�3�>�>�@���	 �D����w�'�"�j�j�l�0�0��a�8���s��#�:��		 ���%
�W��
��
��
�W��
���
�s:�C�C�9/C,�)(C,�C,�C,�C)�(C)�,C>�=C>c�@�tjjd�S)z2Check to see if we are running in a lxd container.z
/dev/lxd/sock)r6r�r�r:r;r<�is_lxdr�	s��
�7�7�>�>�/�*�*r;c�L�tjjdt|�d�}	t	|�}i}d\}}|rd\}}|j||�}|j|�D]"}|s�|j|d�\}	}
|	s�|
||	<�$|S#t
tf$ricYSwxYw)aH
    Return the environment in a dict that a given process id was started with.

    @param encoding: if true, then decoding will be done with
                     .decode(encoding, errors) and text will be returned.
                     if false then binary will be returned.
    @param errors:   only used if encoding is true.z/procr�)��=)r��=r�)	r6r�r[rlr�rdr�rmr9)�pidrj�errorsrr(�env�null�equalr�r`rbs           r<r�r��	s���
�����g�s�3�x��	3�B��#�B�'��
�C�!�K�D�%��#���e��?�?�8�V�4���~�~�d�#������i�i��q�)���s���C��I���J��
�W����	��s�B�B#�"B#c��i}|j�D]}	|jdd�\}}|||<�|S#t$r|}d}Y�wxYw)Nrr�T)r9r)�kvstringr�r�rXrbs     r<�keyval_str_to_dictr�	sc��
�C��~�~����	����3��*�J�S�#���C��
��J��	�	��C��C�	�s�5�
A�Ac�r�|jd�r|dd}tjjd|z�S)Nr�r�z/sys/class/block/%s/partition)r�r6r�r )ras r<�is_partitionr�	s4��
����!������
�7�7�>�>�9�F�B�C�Cr;c��t|t�s|g}g}|D]�}t|t�r|j|��%t|ttf�rmt|�dkst|�dkDrt
d��t|�dk(r#|dr|j|t	|�z���|j|d���t
d��|S)Nr�r2z Invalid package & version tuple.rzInvalid package type.)rkr�rlrr3rXr�)�version_fmt�pkgs�pkglist�pkgs    r<�expand_package_listr�	s����d�D�!��v���G��8���c�3���N�N�3����c�E�4�=�)��3�x�!�|�s�3�x�!�|�"�#E�F�F��3�x�1�}��Q�����{�U�3�Z�7�8���N�N�3�q�6�"��6�7�7�!8�$�Nr;c�<�|jd�D�cgc]}|s�|��	}}d}d}d}d}	t|�D]�\}
}|j�}t|�dkr"|jd|
dzt|�|�y|d}
|
jd�D�cgc]}|s�|��	}}t|�t|�kDr��t	t|�t|��}|d||d|k7r��|	�t|	�t|�kDr��	|jd�}
	||
dz}||
d
z}|
}|}	|d}��|r|r|r
|rr||||fSy|r	|r|r|||fSycc}wcc}w#t$r|jd	|
dz|�YywxYw#t$r|jd|
dz|�YywxYw)
zRReturn the mount information for PATH given the lines from
    /proc/$$/mountinfo.r�N�
z$Line %d has two few columns (%d): %sr�rkr�-z,Did not find column named '-' in line %d: %sr2z/Too few columns after '-' column in line %d: %sr�)r9r_rXr��minrgr�
IndexError)r��mountinfo_linesr2�get_mnt_optsr��
path_elements�devpth�fs_type�match_mount_point�match_mount_point_elementsr�r`r�mount_point�mount_point_elements�x�
mount_optionss                 r<�parse_mount_infor'�	s��!%�
�
�3��5�1�1�Q�5�M�5�
�F��G���!%���_�-�9!���4��
�
����u�:��?��I�I�6��A��s�5�z�4�
���A�h��+6�+<�+<�S�+A�G�a�Q��G��G��#�$�s�=�'9�9��
��(�)�3�}�+=�>����!�$�
�a��(:�:��&�1�c�&�7
��$�%�7&�
�
	����C� �A�	��A��E�l�G��1�q�5�\�F�(��%9�"��a��
�s9!�v��g�"3�
��G�%6�
�F�F�
��g�"3��G�%6�7�7���O6��* H��.�	��I�I�>��A��t�
��		���	��I�I�A�1�q�5�$�
��		�s:�E�E�E
�E
�>E�E8�E5�4E5�8F�Fc��td�j�D]%}|j�dd\}}}||k(s� |||fcSy)z<On older kernels there's no /proc/$$/mountinfo, so use mtab.�	/etc/mtabNrc)r�rUr9)r�r`rr#r s     r<�
parse_mtabr*:
sR���{�+�6�6�8�0��'+�z�z�|�B�Q�'7�$���W��$���7�K�/�/�0�r;c��|jd�}t|�dk(r|dSt|�dk(r|dS|ddvrx|dd}tjgd��\}}|jd	�D]:}|j�}t|�dkDs�"|d|k(s�+|d}t|�St|�Stjd
|�y)Nr�r�rrcr2)r��gptrYr�)�glabel�statusz-sr/z)Unexpected input in find_freebsd_part: %s)r9rXrrlrYrZ)�fs�splitted�target_labelr�r��labelsr�s       r<�find_freebsd_partr3C
s����x�x��}�H�
�8�}�����{��	�X��!�	���{��	�!��/�	/��!�"�v���y�y�!;�<���t��j�j��&�	�F��L�L�N�E��5�z�A�~�%��(�l�":��Q�x����4�y��	�
�4�y�����?��Dr;c���d}|jd�D]K}|j�}t|�dkDs�"tjj	|d|z�s�H|}|S|S)Nr/r2r�)r9rXr6r�r�)r��mnt_list�
path_foundr`r�s     r<�get_path_dev_freebsdr7V
sb���J����t�$����
�
����u�:��>�b�g�g�n�n�U�1�X��_�=��J�����
�r;c���tjdd|gddg��\}}t|�r+tjddg�\}}t||�}|�y|}|j�}t	|d�}d|zS)NrHz-prr�r�r�)rrXr7r9r3)r�r}rer5r6r��
label_parts       r<�get_freebsd_devpthr:`
s|���I�I�w��d�3�!�Q��@�M�V�S�
�3�x��)�)�W�d�O�4���3�)�$��9�
������
�,�,�.�C�"�3�q�6�*�J��Z��r;c��tjdg�\}}d}|jd�D�cgc]}|s�|��	}}d}d}d}	d}
|j�D�]�}tj||�}|s�|jd�}|jd�}|jd�D�cgc]}|s�|��	}
}t
|
�t
|�kDr�xtt
|
�t
|��}|
d||d|k7r��|
�t
|
�t
|
�kDr��|}	|
}
|jd�}|jd	�}|�Ld
j|jd	�jd
�j�jd��}tjd||||�tjd
|�}|st�r|dvrt|�}|}|	|k(s���n|	r|	|vry|rrr|	r	r|||	|fSyyyyrr|	r|||	fSyyycc}wcc}w)z�Return the mount information for PATH given the lines ``mount(1)``
    This function is compatible with ``util.parse_mount_info()``rHze^(?P<devpth>[\S]+?) on (?P<mountpoint>[\S]+?) (\(|type )(?P<type>[^,\(\) ]+)( \()?(?P<options>.*?)\)$r�NrrJrrwr�rOr/zNfound line in mount -> devpth: %s, mount_point: %s, fs_type: %s, options: '%s'z^(/dev/.+)[sp]([0-9])$)�zfs�nfs)rr9rUrerLrkrXrr[rCrYr�rJr:)r�r�mountoutputr��regexr�rrr#r!r"r`rUr$r%r r&�devm�match_devpths                   r<�parse_mountrBn
s^���)�)�W�I�.��[�$�	C�
�
!%�
�
�3��5�1�1�Q�5�M�5�
�F��K���!%���&�&�(�8���I�I�e�T�"��������"���g�g�l�+��+6�+<�+<�S�+A�G�a�Q��G��G��#�$�s�=�'9�9��
��(�)�3�}�+=�>����!�$�
�a��(:�:��&�1�c�&�7
��$�%�7&�
�'��%9�"��'�'�&�/�����	�*�
��$��H�H����	�"�(�(��-�3�3�5�;�;�D�A��M�	�	�	�
�����
	
��y�y�1�6�:���
����)F�(��/�F�����$��q8�t� 1�� =����G�(9�m� �'�+<�m�L�L�?L�(9�G�<��G�(9� �'�+<�=�=�):�G�<��M6�� Hs�H�H�'H	�/H	c�(�dtj�z}tjj|�r't	|�j�}t
||||�Stjjd�rt|�St||�S)Nz/proc/%s/mountinfor))	r6�getpidr�r�r�rUr'r*rB)r�r2r�mountinfo_pathr�s     r<�get_mount_inforF�
sp��:*�B�I�I�K�7�N�	�w�w�~�~�n�%��~�.�9�9�;����e�S�,�?�?�	������	$��$����4��.�.r;�optc�H�t|d���^}}||jd�vS)NT�rrO�rFr9)r�rGr'�mnt_optss    r<�
has_mount_optrL�
s&��!�$�T�:�L�Q���(�.�.��%�%�%r;�Tr�.c��|�g}|�i}tj�}d}|r	tt��}	||i|��}tj�|z
}	d}
|�	tt��|z
}
d|	z}|rt	|
t�r	|d|
zz
}n|dz
}	|||z�|S#t$rY�ywxYw#t$rY�MwxYw#t
$rY|SwxYw#tj�|z
}	d}
|�'	tt��|z
}
n#t$rYnwxYwd|	z}|rt	|
t�r	|d|
zz
}n|dz
}	|||z�w#t
$rYwwxYwxYw)Nz took %0.3f secondsz (%0.2f)z (N/A))r��floatr�rrkr�)r�rr�r�r��
get_uptime�start�ustartr��delta�udelta�tmsgs            r<r�r��
s����|���
�~����I�I�K�E�
�F��	��6�8�_�F���D�#�F�#���	�	��e�#������
��v�x��6�1��%�u�,����&�5�*��
�V�+�+���� ��	��C�$�J���J��1�	��	���
��
���	���J�	��!�	�	��e�#������
��v�x��6�1����
��
��%�u�,����&�5�*��
�V�+�+���� ��	��C�$�J����	��	�s��B#�C�B2�C�#	B/�.B/�2	B>�=B>�	C�
C�E�.D�E�	D�E�D�(E�:E�E�	E�E�E�Ec�N�|jdd�}t|�dkDr|S|dfS)Nr1r�)�rsplitrX)�dottedrgs  r<�expand_dotted_devnamerY"s,���=�=��a� �D�
�4�y�1�}�����~�r;c��|�g}|�g}g}i}||zD]}	t||z|zd��||<�t|�r*t	djdj
|�����|S#t$r||vr|j|�Y�swxYw)NF�rzMissing required files: {files}rO)�files)r�r�rrXrr�r[)r��required�optional�delimrdr�r9s       r<�pathprefix2dictr`*s������������G�
�C�
��
 �"��	"�%�d�U�l�Q�&6�e�D�C��F�"��7�|��-�4�4�3�8�8�G�;L�4�M�
�	
��J��!�	"��H�}����q�!��	"�s�A%�%B�Bc�8�ddddd�}dddd	�}i}t|�j�D]J}	|j�\}}}|rt	|�||z||<�/||vs�4t	|�||z|||<�L|S#t$r|j�\}}d
}Y�WwxYw)N��r��@)�kB�mB�B�gB�total�free�	available)z	MemTotal:zMemFree:z
MemAvailable:rg)r�rUr9rr5)	�meminfo�raw�mpliers�kmapr�r`rXr��units	         r<�read_meminforqBs����%�a�u�=�G���$��D�

�C��w�'�2�2�4�	8��	�#�z�z�|��C�����5�z�G�D�M�1�C��H�
�D�[� ��Z�'�$�-�7�C��S�	�N�	8��J���	�����J�C���D�	�s�A8�8B�Bc�l�|}|jd�r|dd}n|jd�r|dd}dddd	d
d�}|}d}|D]%}|j|�s�|}|dt|�}�'	t|�}|dkrtd|z��t	|||z�S#t$r}td
|z�|�d}~wwxYw)a}Convert human string or integer to size in bytes

    In the original implementation, SI prefixes parse to IEC values
    (1KB=1024B). Later, support for parsing IEC prefixes was added,
    also parsing to IEC values (1KiB=1024B). To maintain backwards
    compatibility for the long-used implementation, no fix is provided for SI
    prefixes (to make 1KB=1000B may now violate user expectations).

    Future prospective callers of this function should consider implementing a
    new function with more standard expectations (1KB=1000B and 1KiB=1024B)

    Examples:
    10M => 10485760
    10MB => 10485760
    10MiB => 10485760
    �iBN���rgrr�rbrcrdl)rg�K�M�GrMrz'%s' is not valid input.z'%s': cannot be negative)r5rXrOrr5)r��size_inrn�num�mplierrUr�s       r<�human2bytesr{Zs���"�G��}�}�T���C�R�y��	
���s�	��C�R�y���E��E��F�G�
�C�
�F�
�$���=�=����F��q�C��F�7�#�C�$�
F��C�j���Q�w��3�g�=�>�>��s�W�V�_�$�%�%��
�F��3�g�=�>�A�E��F�s�'B�	B3�B.�.B3c�j�|�tj�d}|dk(xs|ddk(xr|dddk(}|S)z$Return True if platform is x86-basedNrk�x86_64rr�r2�86)r6r7)�
uname_arch�x86_arch_matchs  r<�is_x86r��sM�����X�X�Z��]�
��8�+���1�
���7��A�B��4�!7���r;c��tjdddkr(tjt	j
|��Stj|�S)Nr2)r2�)r0�version_info�email�message_from_filer�StringIO�message_from_string)r�s r<r�r��sB��
������f�$��&�&�r�{�{�6�':�;�;��$�$�V�,�,r;c�F�tjddgd��}t�}|jj�D]Q}	|j	dd�\}}}|j
d�s�,|jtjdd|���S|S#t
$rY�awxYw)	Nz
dpkg-queryz--listTr@r2)�hi�iiz:.*r�)
rrmrBrUr9rr�rrre�sub)rD�	pkgs_instr`�staterr's      r<�get_installed_packagesr��s���
�)�)�\�8�,�d�
;�C���I��
�
�%�%�'�2��	�"�j�j��q�1�O�U�C�����L�)��M�M�"�&�&���C�0�1�
2�����	��	�s�B�	B �B c�x�d}	tt|d���}|jdd�j�dk(ry	t�}d|vrytd	d��}d|j�vrytjjd
�ryy#t$r!}t
j
d||�Yd}~�ud}~wwxYw)NrnTr[rbr�zubuntu-corez!Unexpected error loading '%s': %sz
snap_core=z/etc/system-image/channel.iniz/etc/system-image/config.d/F)rwr�rxr�rrYrZrIr6r�r)�orpath�orinfor�rDr�s     r<�system_is_snappyr��s����F�D�#�N�6��$F�G���:�:�d�B��%�%�'�=�8��9�
�m�G��w����<�D�I�G���
�
��'��	�w�w�}�}�2�3�����D����7���C�C��D�s�9B�	B9�B4�4B9c��d}|j�D]}|jd�s�|dd}n|�y|jd�r|S|jd�rd|td�dzS|jd�rd|td�dj�zS|jd�rTd	|td�dj�z}tj
j
|�r|St|�}|r|d
S|Sd|zS)Nzroot=r�r�r�z/dev/disk/by-label/zUUID=z/dev/disk/by-uuid/z	PARTUUID=z/dev/disk/by-partuuid/r)r9r�rXr�r6r�r�r�)rDr�r��
disks_path�resultss     r<�rootdev_from_cmdliner��s���E��}�}�����>�>�'�"����G�E���
�}������ �������!�$�u�S��]�_�'=�=�=����� �#�e�C��L�N�&;�&A�&A�&C�C�C�����$�$�u�S��-=�-?�'@�'F�'F�'H�H�	��7�7�>�>�*�%��� ��'����1�:�����U�?�r;c�p�d�}i}||�D]%}|jdd�\}}|s|}|s|s�!|||<�'|S)z�Given shell like syntax (key=value
key2=value2
) in content
    return the data in dictionary form.  If 'add_empty' is True
    then add entries in to the returned dictionary for 'VAR='
    variables.  Set their value to empty_val.c�0�tj|d��S)NT)�comments)�shlexr9)rfs r<�_shlex_splitz(load_shell_content.<locals>._shlex_split�s���{�{�4�$�/�/r;rr�)r9)r��	add_empty�	empty_valr�r_r`rXr�s        r<rwrw�sS��0��D��W�%����Z�Z��Q�'�
��U���E����D��I���Kr;c	��t|�}d}	|t|D�cgc]$}tjj|�s�#|��&c}�z}t	|�dk(rt
j
d|||�gS|dk(rt
j
d|||�||z|kDrntj|�||z
}��t
j
d|||�|Scc}w)Nrz)%sAll files appeared after %s seconds: %sz6%sWaiting up to %s seconds for the following files: %sz*%sStill missing files after %s seconds: %s)	rmr6r�r�rXrYr�r��sleep)�flist�maxwait�naplen�log_pre�need�waitedr9s       r<�wait_for_filesr��s����u�:�D�
�F�
����:�1������q�(9�Q�:�;�;���t�9��>��I�I�;����	
��I��Q�;��I�I�H����	
��F�?�W�$���
�
�6���&���)�,�I�I�4�g�w����K��1;s
�$C
�C
c�<�d�}|jd|gt��y)z-Helper to wait on completion of snap seeding.c��tjd�stjd�ytjgd��y)N�snapz+Skipping snap wait, no snap command present)r��waitr?zseed.loaded)rr�rYr�r:r;r<rbz&wait_for_snap_seeded.<locals>.callbacks+���z�z�&�!��I�I�C�D���	�	�;�<r;zsnap-seeded)�freqN)�runr%)r_rbs  r<�wait_for_snap_seededr�s��=�
�I�I�m�X�r��I�9r;c�T�t|d��}|djd�}|ddk(S)z1Check whether the given mount point is mounted rwTrIrrOr�rwrJ)r#r}�
mount_optss   r<�mount_is_read_writer�s1��
�K�d�
;�F����!�!�#�&�J��a�=�D� � r;c��tjd�syddg}|r5tjj	|�ry|jd|zg�|r|jd|zg�tj|�S)zAInvoke udevadm settle with optional exists and timeout parameters�udevadmN�settlez--exit-if-exists=%sz--timeout=%s)rr�r6r�r�r�)r�r�
settle_cmds   r<�udevadm_settler�!sr���:�:�i� �	��X�&�J�
�
�7�7�>�>�&�!�����0�6�9�:�;�����>�G�3�4�5��9�9�Z� � r;c��t|j|�tj��|rtj|�|S)a
    Print error to stderr and return or exit

    @param msg: message to print
    @param rc: return code (default: 1)
    @param fmt: format string for putting message in (default: 'Error:
 {}')
    @param sys_exit: exit when called (default: false)
    )�file)�printr�r0r1�exit)r�rcr�sys_exits    r<rtrt3s-��
�#�*�*�S�/��
�
�+�������
�Ir;c�Z��eZdZd
�fd�	Zedefd��Zd�Zd�Zd�Z	d�Z
defd	�Z�xZ
S)�Versionc�2��tt|�|||||�S)zPDefault of -1 allows us to tiebreak in favor of the most specific
        number)�superr��__new__)�cls�major�minor�patch�rev�	__class__s     �r<r�zVersion.__new__Ds����W�c�*�3��u�e�S�I�Ir;r#c
�Z�|ttt|jd����S�Nr1)r�r4r5r9)r�r#s  r<�from_strzVersion.from_strIs$���T�#�c�=�7�=�=��#5�6�7�9�9r;c�*�d|j|�k(S)Nr�)�_compare_version�r��others  r<�__gt__zVersion.__gt__Ms���D�)�)�%�0�0�0r;c���|j|jk(xrO|j|jk(xr4|j|jk(xr|j|jk(Sr��r�r�r�r�r�s  r<�__eq__zVersion.__eq__PsX���J�J�%�+�+�%�
&��
�
�e�k�k�)�
&��
�
�e�k�k�)�
&����E�I�I�%�		
r;c#�K�|j|j|j|jfD]}|dk7rt	|����yy�w)z)Iterate over the version (drop sentinels)rN)r�r�r�r�rl)r��ns  r<�__iter__zVersion.__iter__XsA�����*�*�d�j�j�$�*�*�d�h�h�?�	�A��B�w��!�f���		�s�A	Ac�$�dj|�Sr�)r[r�s r<�__str__zVersion.__str__`s���x�x��~�r;rgc���||k(ry|j|jkDry|j|jkDry|j|jkDry|j|jkDryy)z�
        return values:
            1: self > v2
            -1: self < v2
            0: self == v2

        to break a tie between 3.1.N and 3.1, always treat the more
        specific number as larger
        rr�rr�r�s  r<r�zVersion._compare_versioncs]���5�=���:�:����#���:�:����#���:�:����#���8�8�e�i�i���r;)rrrr)r�r�r�r��classmethodrlr�r�r�r�r�r5r��
__classcell__)r�s@r<r�r�BsD���J�
�:�s�:��:�1�
�����r;r�r�)�
extra_message�schedule�
return_log�
deprecated�deprecated_versionr�r�r�c��ttd�st�t_|xsd}t	||z|zt|�z�}tj|�}t
|j|z|j�}|�d|�d|�d|��j�}	|r|	S|tjvr[tjj|�ttd�rtj|	�ytj|	�yy)a�Mark a "thing" as deprecated. Deduplicated deprecations are
    logged.

    @param deprecated: Noun to be deprecated. Write this as the start
        of a sentence, with no period. Version and extra message will
        be appended.
    @param deprecated_version: The version in which the thing was
        deprecated
    @param extra_message: A remedy for the user's problem. A good
        message will be actionable and specific (i.e., don't use a
        generic "Use updated key." if the user used a deprecated key).
        End the string with a period.
    @param schedule: Manually set the deprecation schedule. Defaults to
        5 years. Leave a comment explaining your reason for deviation if
        setting this value.
    @param return_log: Return log text rather than logging it. Useful for
        running prior to logging setup.

    Note: uses keyword-only arguments to improve legibility
    �_logr�z is deprecated in z  and scheduled to be removed in z. r�N)r�	deprecatermr��hashrlr�r�r�r�r�rrrYr�rZ)
r�r�r�r�r��message�dedupr#�version_removed�
deprecate_msgs
          r<r�r�zs���8�9�f�%���	���!�r�G���g�%�(:�:�S��]�J�K�E����1�2�G��g�m�m�h�6��
�
�F�O��,�(��
�>��
�2�g�Y�	(�
�f�h�	�
����I�N�N�"������5�!��3��%��N�N�=�)��K�K�
�&�#r;)r�c��������fd�}|S)a~Mark a "thing" as deprecated. Deduplicated deprecations are
    logged.

    @param deprecated_version: The version in which the thing was
        deprecated
    @param extra_message: A remedy for the user's problem. A good
        message will be actionable and specific (i.e., don't use a
        generic "Use updated key." if the user used a deprecated key).
        End the string with a period.
    @param schedule: Manually set the deprecation schedule. Defaults to
        5 years. Leave a comment explaining your reason for deviation if
        setting this value.

    Note: uses keyword-only arguments to improve legibility
    c�J���tj������fd��}|S)Nc�J���|i|��}t��j����|S)N)r�r�r�r�)r�r�)r�r�rDr�r�r�r�s   ����r<�	decoratorz2deprecate_call.<locals>.wrapper.<locals>.decorator�s3�����'��'�C��#5��=�=�+�!�	
��Jr;)�	functools�wraps)r�r�r�r�r�s` ���r<�wrapperzdeprecate_call.<locals>.wrapper�s&���	����	�		�
�		��r;r:)r�r�r�r�s``` r<�deprecate_callr��s���&
��Nr;rr&c�l�dgi}	tjt|jd�d���}d|vrg|d<|S#t$r)t
j
d|jd��Y|Stj$r0}t
jdtj|�Yd}~|Sd}~wwxYw)N�scopeszhotplug.enabledFr[zFile not found: %sz>Ignoring contents of %s because it is not decodable. Error: %s)r1r2r�r
r�rYr��JSONDecodeErrorrZr�HOTPLUG_ENABLED_FILE)rr�r�s   r<�read_hotplug_enabled_filer��s����r�N�G�#��*�*��5�?�?�+<�=�U�K�
���7�"� "�G�H���N���L��	�	�&����8I�(J�K��N����
����L��)�)�
�	
�	
��N��
�s�/A�.B3�1B3�%B.�.B3c#�K�d��y�w)ztContext manager that does nothing.

    Note: In python-3.7+, this can be substituted by contextlib.nullcontext
    Nr:r:r;r<�nullcontextr��s����
�s�)r|r�)� N)TTr�)rr)r�r�r�)r�r�r�rr)z
/etc/hosts)NraNFNr�)rbN)i�r
)NNNT)�)r�r�F)rb�created)T)r|r)NNF)z
/proc/meminfoF)FN)g�?r�)r�z	Error:
{}F)�rxr
r�rnr�r�rr�rrrr1r3r6�os.pathr>r�r�rer�r�rnr�r�r�r0r��base64r�collectionsrrrrr�rr	r
�pathlibr�typingrr
rrrrrrrrrr�urllibr�	cloudinitrrrrrrrr r!r"r#�cloudinit.settingsr$r%�cloudinit.helpersr&rl�	getLoggerr�rY�sepr�r�r�rr�r�r=rErMrlrqrnrsrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr]r%r-�DEBUGr:r@rDrJrNrQrTrYr[r]rlr�r�rIr�r�r�r�r�r�r�r�r�rrr�r�r;rArFrErWrXr`rhr�r�r^r�r�r�r�r�r�r�r�r�r�r��PathLiker5r�r�r�rIr�r�r�r�r�rr�r�BufferedIOBaserr r$r&r-r7r:r+rFrVrlrprsr{r~r�r�r�r�r�r�r>r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rrrr'r*r3r7r:rBrFrLrMr�rYr�r`rqr{r�r�r�r�r�rwr�r�r�r�rtr�r�r�r�r�r:r;r<�<module>r	s���������
���	���	���
�
�	��
�
��
��
���)�/��/��
�
�
�
������5��'����g����!���F�F�C����v�}�}�
$�v�';�';�
;�
�)��+�
�>����
�����
��:M��c�5�j�)�M��M�
O�e�C��J�'�O�e�O�

�%�
�E�
� �&+�+�\	�y�	�	��	�
�*�� �D��,0�0.�D�0.�l&�$�
�
4� 
� 	�3�	�4�	��
����m�m��
)%�X��(�
�(����
����1�
�1���3�
�3���0�
�0���1�
�1�%��?�%�P��:1�
�:1�z5�p��
�
�
��6�0�&M5�`5�8�G�,�5��5�p��������������
��B!�4�'�%�P(�V.2��d��@9=�,��,�^<�
 �F*���&���(8�V%�P0�$�0�f�
���&1�EI��*EI��6EI�*�$EI�*�(EI�=�@�>�04��	���b�k�k�!�"���h��u�d�{�+�
,���	�
��,04��	P���b�k�k�!�"�P��h��u�d�{�+�
,�P��	P�
	�P����
��$�	�d�	���
�,7�t!*�H-�$�S����	�2�$�$�	��	�����
!%�w��4�"�.���"��"�%�V
�
���
[�|*�
 �
	�
��
���'J�
�'J�T�&5�
��6;����/3��	���&��3��3��/�#�/�#�/�+�C�+�C�+�+�C�+�C�+�
�c�
�d�3�i�
�&
�
��:��	
�
�:�z$��"�J��N�1����*�
�*�Z+�
�<	�D��614�%�K�\�E�&� �T>�n!�u�$/�N&�S�&�T�&�
�C�L��
���
+��3��6�
�+��+�\�$(�$�b�g�g�k�k��0�0(&�V�-���0�>�(�>	:�!�!�$��4�j��$F�G�4��4�v$(���
.'��.'��.'��C�=�	.'�
�.'��
.'�dEF�"��"�/2�"�>A�"�J�W����(�
�Y�t�S�$��/�
��
r;

Zerion Mini Shell 1.0