Current File : //usr/share/netplan/netplan_cli/cli/commands/__pycache__/apply.cpython-312.pyc |
�
Z9
gO � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZmZ ddl
mZ ddlmZmZmZ d Zd
Z G d� de j* � Zy)
znetplan apply command line� N� )�utils� )�
ConfigManager�ConfigurationError)�apply_sriov_config)�OvsDbServerNotRunning�OvsDbServerNotInstalled�apply_ovs_cleanupznetplan-ovs-cleanup.service� c �z � � e Zd Z� fd�Zd� Zd d�Zeg fd�� Zedefd�� Z ed
d�� Z
ed
d�� Z� xZS )�NetplanApplyc �T �� t �| � ddd�� d| _ d| _ d | _ y )N�applyz.Apply current netplan config to running systemT)�
command_id�description�leafF)�super�__init__�
sriov_only�only_ovs_cleanup�state)�self� __class__s ��4/usr/share/netplan/netplan_cli/cli/commands/apply.pyr zNetplanApply.__init__+ s5 �� �
���G�%U�"� � $� ��� %�����
� c � � | j j ddd�� | j j ddd�� | j j dd� � | j | _ | j � | j � y )
Nz--sriov-only�
store_truez0Only apply SR-IOV related configuration and exit)�action�helpz--only-ovs-cleanupz1Only clean up old OpenVSwitch interfaces and exitz--statez0Directory containing previous YAML configuration)r )�parser�add_argument�
command_apply�func�
parse_args�run_command)r s r �runzNetplanApply.run3 s� � ���� � ���&X� !� Z���� � �!5�l�&Y� !� [���� � ��&X� !� Z� �&�&�� ��������r c �` � t � }|r|| _ | j rt j ||� y | j
rt j
|dd|� y dt j v r{t j d� }|�t d� �t j |ddddd dd
g� }|dk7 r6|rt j |� n|dk( rt! d
� �t d|z � �y d}t# t% j$ d� � } t% j$ d� }
||
v r|
j'