HOME


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

܍~c�
���dZddlZddlZddlZddlmZddlmZmZddl	m
Z
mZddlm
Z
dZdd�Zd	�Zd
�Zedkre��dSdS)
zCCommandline utility to list the canonical cloud-id for an instance.�N)�read_cfg_paths)�UXAppStatus�get_status_details)�METADATA_UNKNOWN�canonical_cloud_id)�errorzcloud-idc�.�t���d��}|stjtd���}|�ddddd�	��|�d
dddd�	��|�d
dt|d|�����|S)a*Build or extend an arg parser for the cloud-id utility.

    @param parser: Optional existing ArgumentParser instance representing the
        query subcommand which will be extended to support the args of
        this utility.

    @returns: ArgumentParser with proper argument configuration.
    �
instance_dataz/Report the canonical cloud-id for this instance)�prog�descriptionz-jz--json�
store_trueFz5Report all standardized cloud-id information as json.)�action�default�helpz-lz--longz=Report extended cloud-id information as tab-delimited string.z-iz--instance-dataz,Path to instance-data.json file. Default is )�typerr)r�get_runpath�argparse�ArgumentParser�NAME�add_argument�str)�parser�default_instance_jsons  �8/usr/lib/python3/dist-packages/cloudinit/cmd/cloud_id.py�
get_parserrs���+�,�,�8�8��I�I���
��(��I�
�
�
���������
D������������
L����������
�%�
2�/�
2�
2�
�	�	�	��M�c��t��}|jtjkr>tj�d�|jj����dS|jtj	kr>tj�d�|jj����dS	t|j��5}tj
|��}ddd��n#1swxYwYnS#t$rtd|jz��cYSt $r$}td|j�d|����cYd}~Sd}~wwxYw|�di��}t%|�d	t&��|�d
t&��|�dt&����}|jr=tj�d��||d
<tj|ddd���}n*|jr!|�d|�d
t&����}n|}tj�d|z��dS)z�Handle calls to 'cloud-id' cli.

    Print the canonical cloud-id on which the instance is running.

    @return: 0 on success, 1 on error, 2 on disabled, 3 on cloud-init not run.
    z{0}
��NzTFile not found '%s'. Provide a path to instance data json file using --instance-datazFile 'z' is not valid json. �v1�
cloud_name�region�platformz%DEPRECATED: Use: cloud-init query v1
�cloud_id�T)�,z: )�indent�	sort_keys�
separators�	z%s
r)r�statusr�DISABLED�sys�stdout�write�format�value�NOT_RUN�openr
�json�load�IOErrorr�
ValueError�getrr�stderr�dumps�long)	�name�args�status_details�filer
�er r$�responses	         r�handle_argsrB=s���(�)�)�N���� 4�4�4��
�������(=�(C�D�D�E�E�E��q�	�	�+�"5�	5�	5��
�������(=�(C�D�D�E�E�E��q�
�
�$�$�
%�
%�	,�� �I�d�O�O�M�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,����
�
�
��
%�'+�'9�
:�
�
�	
�	
�	
��
�
�
��u�15�1C�1C�1C�Q�Q�G�
�
�	
�	
�	
�	
�	
�	
�����
����
�	�	�4��	$�	$�B�!�
���|�-�.�.�
���x�)�*�*�
���z�+�,�,���H�
�y�	��
���A�B�B�B�!��:���:��q�D�[�
�
�
���
���'�x�x�����:J�)K�)K�)K�L������J���V�h�&�'�'�'��1sH�6C7�
C+�C7�+C/�/C7�2C/�3C7�7!E�	E�#E�<E�Ec��t��}tjtt|�������dS)z,Tool to query specific instance-data values.N)rr-�exitrBr�
parse_args)rs r�mainrFls7��
�\�\�F��H�[��v�0�0�2�2�
3�
3�4�4�4�4�4r�__main__)N)�__doc__rr4r-�cloudinit.cmd.develr�cloudinit.cmd.statusrr�cloudinit.sourcesrr�cloudinit.utilrrrrBrF�__name__�rr�<module>rOs���
J�I���������
�
�
�
�.�.�.�.�.�.�@�@�@�@�@�@�@�@�B�B�B�B�B�B�B�B� � � � � � ���'�'�'�'�T,
�,
�,
�^5�5�5��z����D�F�F�F�F�F��r