HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/netplan/netplan_cli/cli/commands/__pycache__/generate.cpython-310.pyc
o

ϐxe�
�@sNdZddlZddlZddlZddlZddlZddlmZGdd�dej�Z	dS)znetplan generate command line�N�)�utilscs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�NetplanGeneratecst�jdddd�dS)N�generatezFGenerate backend specific configuration files from /etc/netplan/*.yamlT)�
command_id�description�leaf)�super�__init__��self��	__class__��7/usr/share/netplan/netplan_cli/cli/commands/generate.pyr
s
�zNetplanGenerate.__init__cCs<|jjddd�|jjddd�|j|_|��|��dS)N�
--root-dirzOSearch for and generate configuration files in this root directory instead of /)�help�	--mappingzFDisplay the netplan device ID/backend/interface name mapping and exit.)�parser�add_argument�command_generate�func�
parse_args�run_commandrrrr�run%s��zNetplanGenerate.runc
Cs�dtjvr3t�d�}|durtd��t�|ddddddd	g�}|d
kr1|dkr+td��td
|��dSt�	�g}|j
rB|d|j
g7}|jrL|d|jg7}t�
d|�t�t�|��dS)N�SNAP�busctlzmissing busctl utility�callz--quietz--systemzio.netplan.Netplanz/io/netplan/Netplan�Generater�z8PermissionError: failed to communicate with dbus servicez?RuntimeError: failed to communicate with dbus service: error %srrzcommand generate: running %s)�os�environ�shutil�which�RuntimeError�
subprocessr�PermissionErrorr�get_generator_path�root_dir�mapping�logging�debug�sys�exit)rr�res�argvrrrr0s4

���
z NetplanGenerate.command_generate)�__name__�
__module__�__qualname__r
rr�
__classcell__rrr
rrsr)
�__doc__r*r r,r%r"�r�NetplanCommandrrrrr�<module>s