HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_rightscale_userdata.cpython-311.pyc
�

܍~c7����UddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZdd
lmZdZdZ	d
Zdddeegeggd�Zeed<ee��Zdedede
dededdfd�ZdS)�N)�Logger)�parse_qs)�
url_helper)�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�ALL_DISTROS)�PER_INSTANCE�cc_rightscale_userdata�CLOUD_INIT_REMOTE_HOOKaIThis module adds support for RightScale configuration hooks to cloud-init.
RightScale adds an entry in the format ``CLOUD_INIT_REMOTE_HOOK=http://...`` to
ec2 user-data. This module checks for this line in the raw userdata and
retrieves any scripts linked by the RightScale user data and places them in the
user scripts configuration directory, to be run later by ``cc_scripts_user``.

.. note::
    the ``CLOUD_INIT_REMOTE_HOOK`` config variable is present in the raw ec2
    user data only, not in any cloud-config parts

**Raw user data schema**::

    CLOUD_INIT_REMOTE_HOOK=<url>
zRightScale Userdataz&Support rightscale configuration hooks)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�metar�cfg�cloud�log�args�returnc	��t|dd��}|rt|��s|�d|��dS|��}	t|��}|r	t|vr|�d|t��dSn%#t
$rt
j|d|���wxYwg}g}	|�d��}
|t}t|��D]�\}}
tj�|
d|z��}	tj|
��}|���r3|jr,t
j||d���|�|����#t
$r<}|	�|��t
j|d	t&|
|��Yd}~��d}~wwxYw|r#|�d
t)|����t)|��t)|��kr5t)|��t)|��z
}|�d|��|	r+|�dt)|	����|	d
�dS)N�get_userdata_rawz'Failed to get raw userdata in module %sz:Skipping module %s, did not find %s in parsed raw userdataz1Failed to parse query string %s into a dictionary�scriptszrightscale-%02ii�)�modez!%s failed to read %s and write %sz)Wrote out rightscale userdata to %s filesz%s urls were skipped or failedz2%s failed with exceptions, re-raising the last one���)�getattr�callable�debugr�MY_HOOKNAME�	Exceptionr�logexc�
get_ipath_cur�	enumerate�os�path�join�uhelp�readurl�ok�contents�
write_file�append�MY_NAME�len�warning)rrrrrr�ud�mdict�	wrote_fns�captured_excps�	scripts_d�urls�i�url�fname�resp�e�skippeds                  �I/usr/lib/python3/dist-packages/cloudinit/config/cc_rightscale_userdata.py�handlerCIs����u�&8�$�?�?����8�,<�#=�#=���	�	�;�T�B�B�B���	�	�	�	�B�
�������	��5�0�0��I�I�L���
�
�
�

�F�
1���������D�b�	
�	
�	
�	�	�����I��N�
�#�#�I�.�.�I����D��d�O�O�����C�����Y�(9�Q�(?�@�@��
	��=��%�%�D��w�w�y�y�
(�T�]�
(����t�%�8�8�8�8�� � ��'�'�'����	�	�	��!�!�!�$�$�$��K��8�'�3��
�
�
�
�
�
�
�
�����	�����O��	�	�=�s�9�~�~�N�N�N�
�9�~�~��T���"�"��d�)�)�c�)�n�n�,���	�	�2�G�<�<�<��!����@�����	
�	
�	
��R� � �!�!s%�6A?�?"B!�AE�
F$�(2F�F$)r*�loggingr�urllib.parser�	cloudinitrr-r�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar	r
�cloudinit.distrosr�cloudinit.settingsrr3r%�MODULE_DESCRIPTIONr�__annotations__�__doc__�str�listrC��rB�<module>rSsg��
�	�	�	�	�������!�!�!�!�!�!�)�)�)�)�)�)�������!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�)�)�)�)�)�)�+�+�+�+�+�+�
"��&��A���"#�!�
5�%��}���!�	�	��j�	�	�	��,�t�
�
��(:!�

�:!��:!�#(�:!�/5�:!�=A�:!�	�:!�:!�:!�:!�:!�:!rR