HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/configure/__pycache__/get.cpython-36.opt-1.pyc
3

�T_��@sRddlZddlZddlmZddlmZddlmZeje	�Z
Gdd�de�ZdS)�N)�BasicCommand)�six�)�PREDEFINED_SECTION_NAMEScsleZdZdZejddd�ZdZejddd�Zdddd	d
d�gZ	e
je
jf�fdd
�	Z
dd�Zdd�Z�ZS)�ConfigureGetCommand�getZ	configurez_description.rstz2aws configure get varname [--profile profile-name]z
_examples.rst�varnamez)The name of the config value to retrieve.Zstore�stringT)�nameZ	help_text�actionZ
cli_type_nameZpositional_argcs tt|�j|�||_||_dS)N)�superr�__init__�_stream�
_error_stream)�selfZsession�streamZerror_stream)�	__class__��/usr/lib/python3.6/get.pyr
%szConfigureGetCommand.__init__cCs�|j}d|kr$|jj�}|j|�}n
|j|�}tjd|�t|tj	�rd|j
j|�|j
jd�dSt|t�r�|j
jd|�dSdSdS)N�.zConfig value retrieved: %s�
rzBvarname (%s) must reference a value, not a section or sub-section.r)r�_sessionZget_scoped_configr�_get_dotted_config_value�LOG�debug�
isinstancerZstring_typesr�write�dictr)r�argsZparsed_globalsr�config�valuerrr�	_run_main*s 


zConfigureGetCommand._run_mainc
Cs`|jd�}|jd�}|dkrr|dtkrr|jj}|jd�\}}|j|i�j|�}|dkrn|dj|i�j|�}|S|ddkr�|d}|d}|dd�}	nj|ddks�|d|jjdkr�|d}|d}|dd�}	n,|jjd�}|dkr�d}|d}|dd�}	|jjdj|i�j|�}t|	�dk�r\y|j|	d	�}Wntk
�rZd}YnX|S)
NrrrZprofilesZprofile���default���)	�split�countrr�full_configrZget_config_variable�len�AttributeError)
rr�partsZnum_dotsr(ZsectionZconfig_namer Zprofile_nameZ	remainingrrrrFs@


z,ConfigureGetCommand._get_dotted_config_value)�__name__�
__module__�__qualname__�NAMErZ	FROM_FILEZDESCRIPTIONZSYNOPSISZEXAMPLESZ	ARG_TABLE�sys�stdout�stderrr
r!r�
__classcell__rr)rrrsr)r0ZloggingZawscli.customizations.commandsrZ
awscli.compatr�rZ	getLoggerr,rrrrrr�<module>
s