403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/cmd/devel/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/cmd/devel/__pycache__/net_convert.cpython-36.opt-1.pyc
3

?q,d\�@s�dZddlZddlZddlZddlZddlmZmZmZddl	m
Z
mZmZm
Z
mZddlmZddlmZddlmZdZdd	d
�Zdd�Zed
kr�e�j�Zeee�dS)z(Debug network config format conversions.�N)�distros�log�safeyaml)�eni�netplan�
network_state�networkd�	sysconfig)�DataSourceAzure)�
DataSourceOVF)�	openstackznet-convertcCs�|stjttd�}|jddtdddd�|jdd	d
ddd
dgddd�|jdddddd�|jdddd�tjj�D�dd�|jdddddd�|jd d!d"d#�|jd$d%d
d&d'd(gdd)d�|S)*aBuild 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--kindrznetwork_data.json�yamlz
azure-imdsz
vmware-imcz&The format of the given network config)�choicesrrz-dz--directoryzdirectory to place output in)rrrz-Dz--distrocSsg|]}|D]}|�qqS�r)�.0Zsublist�itemrr�!/usr/lib/python3.6/net_convert.py�
<listcomp><szget_parser.<locals>.<listcomp>)rrz-mz--maczname,mac�appendzinterface name to mac mapping)r�actionrz--debug�
store_truezenable debug logging to stderr.)rrz-Oz
--output-kindrrr	z!The network config format to emit)	�argparse�ArgumentParser�NAME�__doc__�add_argument�openrZ
OSFAMILIES�values)�parserrrr�
get_parsersZ
r&cCs�|jjd�s|jd7_tjj|j�s4tj|j�|jrJtjtj	d�ntjtj
d�|jr�i}x,|jD]}|jdd�\}}|||<qjWnd}|j
j�}|jdkr�tj|�}n�|jdk�rtj|�}d|kr�|jd�}|j�rltjjdjd	tj|�d
g��nl|jdk�r"tjtj|�|d�}nJ|jd
k�r@tjtj|��}n,|jdk�rlt j!t j"|j
j#��}t j$|d�}t%j&|�}	|j�r�tjjdjd
dtj|	�d
g��t'j(|j)�}
|
|j)id�}i}|j*dk�r�tj+}|j,jd�}n�|j*dk�r$t-j+}|j,jd�}d|d<|ddd�|d<ddg|d<nH|j*dk�rDt.j+}|j,jd�}n(|j*dk�rdt/j+}|j,jd�}nt0d��||d�}
tjjd
jd|j|j
j#fd|j*|jfg�d�|
j1|	|jd�dS)N�/)�level�,�rrZnetwork�
z
Input YAML�znetwork_data.json)�
known_macsz
azure-imdsz
vmware-imcFzInternal StaterZpostcmdsZnetplan_pathzdhcp-use-domainszipv6-mtuZfeaturesrr	zInvalid output_kind)�configz"Read input format '%s' from '%s'.
z!Wrote output format '%s' to '%s'
)r�target)2Z	directory�endswith�os�path�isdir�makedirs�debugrZsetupBasicLogging�DEBUGZWARNZmac�splitZnetwork_data�readZkindrZconvert_eni_datar�load�get�sys�stderr�write�join�dumpsrZconvert_net_json�json�loads�azureZparse_network_config�ovfZConfigZ
ConfigFile�nameZget_network_config_from_confrZparse_net_config_datarZfetch�distroZoutput_kindZRendererZrenderer_configsrrr	�RuntimeErrorZrender_network_state)rD�argsr-rZ
iface_nameZ	iface_macZnet_dataZpre_nsr.�nsZ
distro_clsrEZr_cls�rrrr�handle_argsTs~





rJ�__main__)N)r!rr@r1r;Z	cloudinitrrrZ
cloudinit.netrrrrr	Zcloudinit.sourcesr
rBrrCZcloudinit.sources.helpersrr r&rJ�__name__�
parse_argsrGrrrr�<module>s
BU


Youez - 2016 - github.com/yon3zu
LinuXploit