OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function :
oB]c @ sq d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z e Z
d Z d Z d Z
d S(
s
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=
iN( t PER_INSTANCE( t
url_helper( t util( t parse_qst cc_rightscale_userdatat CLOUD_INIT_REMOTE_HOOKc C s y | j } Wn" t k
r4 | j d | d SXy: t | } | sW t | k rn | j d | t d SWn' t k
r t j | d | n Xg } g } | j d } | t }
x t |
D] \ } } t j
j | d | }
yN t j
| } | j r=| j r=t j |
| d d | j |
n Wq t k
ry} | j | t j | d t | |
q Xq W| r| j d t | n t | t |
k rt |
t | } | j d
| n | r| j d t | | d n d S(
Ns' Failed to get raw userdata in module %ss: Skipping module %s, did not find %s in parsed raw userdatas1 Failed to parse query string %s into a dictionaryt scriptss rightscale-%02it modei s! %s failed to read %s and write %ss) Wrote out rightscale userdata to %s filess %s urls were skipped or faileds2 %s failed with exceptions, re-raising the last onei( t get_userdata_rawt Exceptiont debugR t MY_HOOKNAMER t logexct
get_ipath_curt enumeratet ost patht joint uhelpt readurlt okt contentst
write_filet appendt MY_NAMEt lent warning( t namet _cfgt cloudt logt _argst udt mdictt wrote_fnst captured_excpst scripts_dt urlst it urlt fnamet respt et skipped( ( sK /usr/lib/python2.7/site-packages/cloudinit/config/cc_rightscale_userdata.pyt handleB sN
( t __doc__R t cloudinit.settingsR t cloudinitR R R t six.moves.urllib_parseR t frequencyR R R, ( ( ( sK /usr/lib/python2.7/site-packages/cloudinit/config/cc_rightscale_userdata.pyt ! s