PHP WebShell

Текущая директория: /usr/share/netplan/netplan/cli/commands/__pycache__

Просмотр файла: set.cpython-310.pyc

o

�
edx�@sTdZddlZddlZddlZddlmZddlmZdZddgZ	Gdd�de�Z
dS)	znetplan set command line�N)�NetplanCommandz70-netplan-set.yaml�renderer�versioncs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�
NetplanSetcst�jdddd�dS)N�setzTAdd new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=trueT)�
command_id�description�leaf)�super�__init__��self��	__class__��./usr/share/netplan/netplan/cli/commands/set.pyr!s
�zNetplanSet.__init__cCsR|jjdtdd�|jjdtdd�|jjdddd	�|j|_|��|��dS)
N�	key_valuezNThe nested key=value pair in dotted format. Value can be NULL to delete a key.)�type�helpz
--origin-hintz�Can be used to help choose a name for the overwrite YAML file.                                        A .yaml suffix will be appended automatically.z
--root-dir�/zAOverwrite configuration files in this root directory instead of /)�defaultr)�parser�add_argument�str�command_set�func�
parse_args�run_commandrrrr�run&s
�
�
�zNetplanSet.runcCs�|jdurt|j�dkrtd��|jrd�|jdf�}nd}|j�dd�}t|�dkr/td��|\}}|�d	�s?d�d	|f�}d
d�t�d|�D�}t�	�}t
����}t�|||�|�
�|�dtj�|�|�|�|j�|�dtj�|�|�t��}|�|�|r�t�	�}	|�dtj�|	�|�|�dtj�|	j||d
�|	�|j�|�dtj�|	�|�t��}
|
�|	�|
�||j�n|�t|j�Wd�dSWd�dS1s�wYdS)NrzInvalid/empty origin-hint�.�yaml�=��zInvalid value specified�networkcSsg|]}|�dd��qS)z\.r)�replace)�.0�srrr�
<listcomp>Dsz*NetplanSet.command_set.<locals>.<listcomp>z	(?<!\\)\.)�
constraint)�origin_hint�len�	Exception�joinr�split�
startswith�re�
libnetplan�Parser�tempfile�
TemporaryFile�create_yaml_patch�flush�seek�io�SEEK_SET�load_nullable_fields�load_yaml_hierarchy�root_dir�	load_yaml�State�import_parser_results�load_nullable_overrides�write_yaml_file�update_yaml_hierarchy�FALLBACK_FILENAME)r
�filenamer.�key�value�	yaml_pathr�tmp�state�parser_output_file�state_output_filerrrr4sN







�8"�zNetplanSet.command_set)�__name__�
__module__�__qualname__rrr�
__classcell__rrrrrsr)�__doc__r3r0r8�netplan.cli.utilsr�netplan.libnetplanr1rC�GLOBAL_KEYSrrrrr�<module>s

Выполнить команду


Для локальной разработки. Не используйте в интернете!