Your IP : 216.73.216.52


Current Path : /usr/share/netplan/netplan/cli/commands/__pycache__/
Upload File :
Current File : //usr/share/netplan/netplan/cli/commands/__pycache__/get.cpython-38.pyc

U

�]a+
�@sHdZddlZddlZddlmmZddlmZGdd�dej�Z	dS)znetplan get command line�N)�
ConfigManagercs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�
NetplanGetcst�jdddd�dS)N�getzRGet a setting by specifying a nested key like "ethernets.eth0.addresses", or "all"T)�
command_id�description�leaf)�super�__init__��self��	__class__��./usr/share/netplan/netplan/cli/commands/get.pyr	s�zNetplanGet.__init__cCsD|jjdtdddd�|jjdddd	�|j|_|��|��dS)
N�key�?�allzThe nested key in dotted format)�type�nargs�default�helpz
--root-dir�/z>Read configuration files from this root directory instead of /)rr)�parser�add_argument�str�command_get�func�
parse_args�run_commandr
rrr�run"s
�zNetplanGet.runcCs�t|jd�}|��|j}|jdkr�|j�d�sF|jdksFd|j|_t�d|j�D]<}|�dd�}||�	�kr�||}t
|t�s�q�qTd}q�qTtj
|dd	�dd
�}t
|t�s�t
|t�s�|dd�}t|�dS)N)�prefixrznetwork.�networkz	(?<!\\)\.z\.�.F)�default_flow_style������)r�root_dir�parse�treer�
startswith�re�split�replace�keys�
isinstance�dict�yaml�dump�list�print)r�config_managerr(�k�outrrrr,s$

zNetplanGet.command_get)�__name__�
__module__�__qualname__r	rr�
__classcell__rrrrrs
r)
�__doc__r0r*�netplan.cli.utils�cli�utils�netplan.configmanagerr�NetplanCommandrrrrr�<module>s