| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3.9/site-packages/cfnbootstrap/__pycache__/ |
Upload File : |
a
��0inm � @ s6 d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m
Z
d dl mZ d dlm
Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl mZ d dlZd dlZe�d �Zd
d� ZG dd
� d
e�Z G dd� de�Z!G dd� de"�Z#G dd� de"�Z$G dd� de"�Z%G dd� de"�Z&dS )� N)�util)�
AwsQueryError)�CloudFormationClient)� SQSClient)�
ProcessHelper)�Timer)�Credentialszcfn.hupc
C s� t j�| d�}t j�|�s&td| ��t�� }|�|� |�dd�sLtd��|�dd�}|�dd�rxt �
|�dd��}nb|�dd�r�zt �|�dd��}W q� ty� } ztd|j
��W Y d }~q�d }~0 0 n
td d �}t j�| d
�}g }t j�|��r8t �|�D ]2}t j�t j�||���r|�t j�||�� �qt�� } | �t j�| d�g| �}
|
�sztdt j�| d�|f ��g }g }| �� D �]&}
| �|
d
��s�t�d|
� �q�dd� | �|
d
��d�D �}| �|
d��s�t�d|
� �q�| �|
d��st�d|
� �q�d }| �|
d��r(| �|
d��� }t|
|| �|
d��� | �|
d�|�}|�� �r�| �|
d��rxt �| �|
d��|_| �|
d��r�t �| �|
d��|_|�|� n
|�|� �q�|�s�|�s�td��d}|�dd��r�|�dd�}t�|�}|�dd��r
|�dd�}t|||�}|�dd��r<|�dd�}t �|�}nd}|�rTt|||�}nd }|�r�t�|�}|�dd��r�|�dd�}t|||d �}t |||t|||�|�}nd }|||fS )!Nzcfn-hup.confz'Could not find main configuration at %s�main�stackz([main] section must contain stack optionZrolezcredential-filez-Could not retrieve credentials from file:
%s� zhooks.dz
hooks.confz)No hook configurations found at %s or %s.�triggersz!No triggers specified for hook %sc S s g | ]}|� � �qS � )�strip)�.0�sr
r
�=/usr/lib/python3.9/site-packages/cfnbootstrap/update_hooks.py�
<listcomp>\ s �z parse_config.<locals>.<listcomp>�,�pathzNo path specified for hook %s�actionzNo action specified for hook %s�runas� singleton�send_resultzNo valid hooks foundz us-east-1�region�urlzmulti-threadedT�sqs_url)r )!�osr �join�isfile�
ValueError�ConfigParser�readZ
has_option�getr ZRoleBasedCredentialsZextract_credentials�IOError�strerrorr �isdir�listdir�appendZsections�logging�error�splitr �Hook�is_cmd_hookZinterpret_booleanr r r ZendpointForRegion�
HookProcessorr �CmdProcessor)Zconfig_pathZmain_conf_pathZmain_configr
�credentials�eZadditional_hooks_pathZadditional_filesZ hook_fileZhooks_configZ
files_read�hooksZ cmd_hooksZsectionr r �hookr Zcfn_url�
cfn_client�value�multi_threadedZ processorr �
sqs_clientZ
cmd_processorr
r
r �parse_config) s� �
�
��
�
���
�
�
�
��r7 c @ s e Zd Zdd� Zdd� ZdS )�FatalUpdateErrorc C s
|| _ d S �N��msg��selfr; r
r
r �__init__� s zFatalUpdateError.__init__c C s | j S r9 r: �r= r
r
r �__str__� s zFatalUpdateError.__str__N��__name__�
__module__�__qualname__r>