📂 FileMgr
📍
/
usr
/
lib
/
python3
/
dist-packages
/
cloudinit
/
cmd
/
devel
/
__pycache__
✏️ /usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/net_convert.cpython-312.pyc
✕ Tutup
� ��i! � �R � d Z ddlZddlZddlZddlZddlZddlZddlmZm Z ddl mZ ddlm Z mZmZmZmZmZ ddlmZ dZ dd lmZ dZ dd lmZ dZdZdd�Zd � Z e!dk( r e� jE � Z# e ee#� yy# e$ r dZY �Iw xY w# e$ r dZY �Mw xY w# e$ r dZY �Qw xY w)z(Debug network config format conversions.� N)�distros�safeyaml)�loggers)�eni�netplan�network_manager� network_state�networkd� sysconfig)�DataSourceAzureTF)� openstack)�guestcust_utilznet-convertc � � | st j t t �� } | j ddt ddd�� dd g}t r|j d � t r|j d� t r|j d� | j d d|dd�� | j ddddd�� | j ddt j j � D ��cg c] }|D ] }|�� � c}}d�� | j ddddd�� | j ddd �!� | j d"d#g 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�helpr �yaml� azure-imds�network_data.json� vmware-imcz-kz--kindz&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�open�azure_kind_availabler �openstack_kind_available�vmware_kind_availabler � OSFAMILIES�values)�parser�available_kinds�sublist�items �A/usr/lib/python3/dist-packages/cloudinit/cmd/devel/net_convert.py� get_parserr0 1 s� � � ��(�(�d��H�� ����� ��� 0� � � �f�o�O�����|�,�����2�3�����|�,� ������� 5� � � ������ +�� � � ����� '� 2� 2� 9� 9� ;� ��� �@D�D� �� � � � � ������� ,� � � ����,�-N� � � �����N�� 0� � � �M��- s � D>c �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� \ }}|||<