![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/cloudinit/cmd/__pycache__/ |
o }��fk, � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZm Z ddl mZ ddlm Z mZmZ ddlmZ ddlmZ d Ze�e�Zdd d�Zdd � Zdefdd�Zdedededefdd�Zdd� Zdd� Z edkrqe � dS dS )aT Query 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 C s� | s t jttd�} | jdddddd� | jdd td t� �d�� �d� | jd ddddd� | jddtdd� | jddtdd� | jdtddd� | jddddddd� | jdd td!d"d#� | S )$a# Build 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)�typer z-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 �nargsr z-az--all�dump_allz Dump all available instance-data)r r �destr z-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 }}")r r r )�argparse�ArgumentParser�NAME�__doc__�add_argument�strr �get_runpath��parser� r# �5/usr/lib/python3/dist-packages/cloudinit/cmd/query.py� get_parser&