/usr/share/netplan/netplan/cli/commands/__pycache__
NameSizeModeActions
apply.cpython-38.pyc91460644editdlrm
generate.cpython-38.pyc20170644editdlrm
get.cpython-38.pyc22130644editdlrm
info.cpython-38.pyc17510644editdlrm
ip.cpython-38.pyc46330644editdlrm
migrate.cpython-38.pyc106360644editdlrm
set.cpython-38.pyc55720644editdlrm
sriov_rebind.cpython-38.pyc17010644editdlrm
try_command.cpython-38.pyc58770644editdlrm
__init__.cpython-38.pyc8160644editdlrm
Edit: /usr/share/netplan/netplan/cli/commands/__pycache__/ip.cpython-38.pyc (4633B)
U )/b@sdZddlZddlZddlZddlZddlmZddlmmZddddddd Z Gd d d ej Z Gd d d ej Z dS)znetplan ip command lineN)CalledProcessErrorz#run/systemd/netif/leases/{lease_id}ifindex)patternmethodzszNetplanIpLeases.__init__cCs<|jjddd|jjddd|j|_||dS)N interfacez1Interface for which to display IP lease settings.)r --root-dirzBSearch for configuration files in this root directory instead of /)parser add_argumentcommand_ip_leasesrr r!rrrrrCszNetplanIpLeases.runc sjdkrfdd}tg}jr<|djg7}|djg7}td|ztj|dd}Wnt k rt d YnXi}| d }|D]}| d \}}|||<q||dS) Nrc sfdd}fdd}t|dd}t|dd}zltd|}ttjd jrftjjnd |jj |d  }| D]}t | qW5QRXWnHt k r}z*t d j t|ftjd tdW5d}~XYnXdS)Nc stjdjd}z2t| }|dW5QRWSQRXWn6tk rz}zt d|t |W5d}~XYnXdS)Nz/sys/class/netrrzCannot read file %s: %s) ospathjoinr&open readlinesstrip Exceptionloggingdebugstr)Z ifindex_fferrrlease_method_ifindexTs (zXNetplanIpLeases.command_ip_leases..find_lease_file..lease_method_ifindexc sztjdddjgdditjd}|jD]}|d}d|kr(|d d }tjdd dd |gdditjd}|jD]6}|d}d |krz|d d WSqzq(Wn2t k r}zt dt |W5d}~XYnXt ddS)NnmclidevZshowLC_ALLC)envstdoutzutf-8zGENERAL.CONNECTION:Zconidzconnection.uuidz@Could not find a NetworkManager connection for the interface: %sz.find_lease_file..lease_method_nm_connectionZbackendrrZ lease_method_/)r&lease_idz%No lease found for interface '%s': %s)filer?) lease_pathevalr.r+r,r-root_dirabspathformatr&r/printrFr1r4sysstderrexit) mappingr7rHZ lease_patternZ lease_methodrKr5rGr6rrrfind_lease_fileSs(   z:NetplanIpLeases.command_ip_leases..find_lease_filer'z --mappingzcommand ip leases: running %sT)universal_newlinesr?,=)r& print_usageutilsget_generator_pathrOr2r3rA check_outputrrSrUrEr0) rrWargvoutrVZ mapping_sZkeyvaluekeyvaluerrrr*Ns$  5    z!NetplanIpLeases.command_ip_leases)r"r#r$rrr*r%rrrrr<s  r) __doc__r2r+rSrArnetplan.cli.utilsclir\rMNetplanCommandrrrrrrs