Current File : //usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/net_convert.cpython-312.pyc |
�
ӇgJ � �� � d Z ddlZddlZddlZddlZddlZddlZddlmZm Z ddl
mZ ddlm
Z
mZmZmZmZmZ ddlmZ ddlmZ ddlmZ d Zd
d
�Zd� Zedk( r e� j= � Z eee� yy)z(Debug network config format conversions.� N)�distros�safeyaml)�loggers)�eni�netplan�network_manager�
network_state�networkd� sysconfig)�DataSourceAzure)� openstack)�guestcust_utilznet-convertc
� � | st j t t �� } | j ddt
ddd�� | j dd g d
�dd�� | j d
dddd�� | j ddt j j � D ��cg c] }|D ] }|�� �
c}}d�� | j ddddd�� | j ddd�� | j ddg d �dd!�� | S c c}}w )"a Build or extend and arg parser for net-convert utility.
@param parser: Optional existing ArgumentParser instance representing the
subcommand which will be extended to support the args of this utility.
@returns: ArgumentParser with proper argument configuration.
)�prog�descriptionz-pz--network-data�PATHTz!The network configuration to read)�type�metavar�required�helpz-kz--kind)r �network_data.json�yaml�
azure-imds�
vmware-imcz&The format of the given network config)�choicesr r z-dz--directoryzdirectory to place output in)r r r z-Dz--distro)r r z-mz--maczname,mac�appendzinterface name to mac mapping)r �actionr z--debug�
store_truezenable debug logging to stderr.)r r z-Oz
--output-kind)r r r
r �network-managerz!The network config format to emit) �argparse�ArgumentParser�NAME�__doc__�add_argument�openr �
OSFAMILIES�values)�parser�sublist�items �A/usr/lib/python3/dist-packages/cloudinit/cmd/devel/net_convert.py�
get_parserr, sO � � ��(�(�d��H��
�����
���
0�
� � �����
� �
5� � � ������
+�� � � ����� '� 2� 2� 9� 9� ;�
���
�@D�D�
��
� �
� � �������
,� � � ����,�-N� � � �����N��
0� � � �M��-
s �C7c
�Z
� |j j d� s|xj dz
c_ t j j |j � st j
|j � |j r%t j t j �� n$t j t j �� |j r.i }|j D ] }|j dd� \ }}|||<