404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.142.36.215: ~ $
3

\�me\'�@s�ddlZddlZddlmZddlmZmZmZddlm	Z	ddl
mZddlm
Z
eje�ZdZdZd	ZGd
d�dej�Zdd
d�Zedfdd�Zddd�Zddd�ZdS)�N)�List)�distros�subp�util)�Apt)�PackageManager)�HostnameConfa8# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
z'/etc/network/interfaces.d/50-cloud-initz/etc/default/localecs�eZdZdZddd�Zeded�ededd	�d�Z�fd
d�Zdd
�Zd'dd�Z	�fdd�Z
dd�Zdd�Zdd�Z
d(dd�Zdd�Zdd�Zd)d d!�Zd"d#�Zeeeed$�d%d&�Z�ZS)*�Distroz
/etc/hostnamez'/etc/network/interfaces.d/50-cloud-initz/etc/netplan/50-cloud-init.yaml)�eni�netplanr
)Zeni_pathZ
eni_headerrT)Znetplan_pathZnetplan_headerZpostcmdscs@t�j|||�d|_d|_d|_tj|j|�|_|jg|_	dS)NZdebianzC.UTF-8)
�super�__init__Zosfamily�default_locale�
system_localerZfrom_configZ_runner�aptZpackage_managers)�self�nameZcfg�paths)�	__class__��/usr/lib/python3.6/debian.pyr
3szDistro.__init__cCs |jst�|_|jr|jS|jS)z9Return the default locale if set, else use default locale)r�read_system_localer)rrrr�
get_locale>szDistro.get_localeN�LANGc	Cs�|st}|std��|j�}tjj|�}|j}|rFtjdt|j	�ntjd|jt�|j
�|j
�kpn|pn|}|p||p||}|r�t|||d�ntjd||j|�|r�t|||d�d|_dS)zeApply specified locale to system, regenerate if specified locale
        differs from system default.zFailed to provide locale value.zVSystem locale not found in %s. Assuming system locale is %s based on hardcoded defaultzSystem locale set to %s via %s)�keynamez9System has '%s=%s' requested '%s', skipping regeneration.N)
�LOCALE_CONF_FN�
ValueErrorr�os�path�existsr�LOG�debugr�lower�regenerate_locale�update_locale_conf)	r�localeZout_fnrZ
distro_localeZconf_fn_existsZsys_locale_unsetZ
need_regenZ	need_confrrr�apply_localeIs<
zDistro.apply_localecst�t�j||�S)N)�_maybe_remove_legacy_eth0r�_write_network_state)r�args�kwargs)rrrr(zszDistro._write_network_statecCsnd}y|j|�}Wn.tk
r@tj|jdd�}|r8ndSYnX|sNtd�}|j|�tj|t|�d�dS)N�create_hostname_fileT�i�)	�_read_hostname_conf�IOErrorrZget_cfg_option_boolZ_cfgrZset_hostname�
write_file�str)r�hostname�filename�confr+rrr�_write_hostname~s

zDistro._write_hostnamecCs|j|j�}|j|fS)N)�_read_hostname�hostname_conf_fn)rZsys_hostnamerrr�_read_system_hostname�szDistro._read_system_hostnamecCsttj|��}|j�|S)N)rr�	load_file�parse)rr2r3rrrr-�szDistro._read_hostname_confcCs:d}y|j|�}|j}Wntk
r,YnX|s6|S|S)N)r-r1r.)rr2�defaultr1r3rrrr5�s

zDistro._read_hostnamecCsdS)Nz	127.0.1.1r)rrrr�_get_localhost_ip�szDistro._get_localhost_ipcCstj||j|�d�dS)N)�tzZtz_file)rZset_etc_timezoneZ
_find_tz_file)rr<rrr�set_timezone�szDistro.set_timezonecCs(|dkrtd|�d���|jjd�dS)NZupgradezUnable to handle z command)�RuntimeErrorrZrun_package_command)rZcommandr)Zpkgsrrr�package_command�szDistro.package_commandcCstj�S)N)rZget_dpkg_architecture)rrrr�get_primary_arch�szDistro.get_primary_arch)�layout�model�variant�optionsc
Cs^djddd|�d�d|�d�d|�d�d|�d�dd	dg	�}tjd
|ddd
�|jdd�dS)N�
z'# This file was generated by cloud-initr,z
XKBMODEL="�"zXKBLAYOUT="zXKBVARIANT="zXKBOPTIONS="zBACKSPACE="guess"z/etc/default/keyboardi��w)r2Zcontent�modeZomodeZrestartz
console-setup)�joinrr/Zmanage_service)rrArBrCrD�contentsrrr�
set_keymap�s 



zDistro.set_keymap)Nr)N)NN)�__name__�
__module__�__qualname__r6Znetwork_conf_fn�NETWORK_FILE_HEADERZrenderer_configsr
rr&r(r4r7r-r5r;r=r?r@r0rK�
__classcell__rr)rrr	!s*
1

r	�"/etc/network/interfaces.d/eth0.cfgcCs�tjj|�sdSd}yPtj|�}ddg}dd�|j�D�}||krVtj|�d|}n|d|}Wn tk
r�|d	|}YnXtj	|�dS)
aOUbuntu cloud images previously included a 'eth0.cfg' that had
    hard coded content.  That file would interfere with the rendered
    configuration if it was present.

    if the file does not exist do nothing.
    If the file exists:
      - with known content, remove it and warn
      - with unknown content, leave it and warn
    Nz(Dynamic networking config may not apply.z	auto eth0ziface eth0 inet dhcpcSsg|]}|jd�s|j��qS)�#)�
startswith�strip)�.0�frrr�
<listcomp>�sz-_maybe_remove_legacy_eth0.<locals>.<listcomp>zremoved %s with known contentsz* '%s' exists with user configured content.z" %s exists, but could not be read.)
rrrrr8�
splitlinesZdel_file�	Exceptionr Zwarning)rZbmsgrJZknown_contents�lines�msgrrrr'�s


r'rcCsDd}|std|��tjj|�r@tj|�}tj|�}|j|d�}|S)z.Read system default locale setting, if presentr,zInvalid path: %s)rrrrrr8Zload_shell_content�get)�sys_pathrZsys_valZlocale_contentZsys_defaultsrrrr�s

rcCs4tjd|||�tjdd|d||fgdd�dS)zUpdate system locale configz%Updating %s with locale setting %s=%sz
update-localez--locale-file=z%s=%sF)�captureN)r r!r)r%r]rrrrr$sr$cCs@|j�d
krtjd||�dStjd|�tjd|gdd	�dS)z�
    Run locale-gen for the provided locale and set the default
    system variable `keyname` appropriately in the provided `sys_path`.

    �c�c.utf-8�posixz$%s=%s does not require rengenerationNzGenerating locales for %sz
locale-genF)r^)r_r`ra)r"r r!r)r%r]rrrrr#s
r#)rQ)r)r)ZloggingrZtypingrZ	cloudinitrrrZ(cloudinit.distros.package_management.aptrZ4cloudinit.distros.package_management.package_managerrZ"cloudinit.distros.parsers.hostnamerZ	getLoggerrLr rOZNETWORK_CONF_FNrr	r'rr$r#rrrr�<module>
s 
9
 


Filemanager

Name Type Size Permission Actions
OpenCloudOS.cpython-36.opt-1.pyc File 542 B 0644
OpenCloudOS.cpython-36.pyc File 542 B 0644
TencentOS.cpython-36.opt-1.pyc File 540 B 0644
TencentOS.cpython-36.pyc File 540 B 0644
__init__.cpython-36.opt-1.pyc File 35.6 KB 0644
__init__.cpython-36.pyc File 35.6 KB 0644
almalinux.cpython-36.opt-1.pyc File 313 B 0644
almalinux.cpython-36.pyc File 313 B 0644
alpine.cpython-36.opt-1.pyc File 6.78 KB 0644
alpine.cpython-36.pyc File 6.78 KB 0644
amazon.cpython-36.opt-1.pyc File 450 B 0644
amazon.cpython-36.pyc File 450 B 0644
arch.cpython-36.opt-1.pyc File 7.33 KB 0644
arch.cpython-36.pyc File 7.33 KB 0644
bsd.cpython-36.opt-1.pyc File 4.87 KB 0644
bsd.cpython-36.pyc File 4.87 KB 0644
bsd_utils.cpython-36.opt-1.pyc File 1.09 KB 0644
bsd_utils.cpython-36.pyc File 1.09 KB 0644
centos.cpython-36.opt-1.pyc File 310 B 0644
centos.cpython-36.pyc File 310 B 0644
cloudlinux.cpython-36.opt-1.pyc File 314 B 0644
cloudlinux.cpython-36.pyc File 314 B 0644
cos.cpython-36.opt-1.pyc File 309 B 0644
cos.cpython-36.pyc File 309 B 0644
debian.cpython-36.opt-1.pyc File 7.52 KB 0644
debian.cpython-36.pyc File 7.52 KB 0644
dragonflybsd.cpython-36.opt-1.pyc File 361 B 0644
dragonflybsd.cpython-36.pyc File 361 B 0644
eurolinux.cpython-36.opt-1.pyc File 313 B 0644
eurolinux.cpython-36.pyc File 313 B 0644
fedora.cpython-36.opt-1.pyc File 310 B 0644
fedora.cpython-36.pyc File 310 B 0644
freebsd.cpython-36.opt-1.pyc File 6.21 KB 0644
freebsd.cpython-36.pyc File 6.21 KB 0644
gentoo.cpython-36.opt-1.pyc File 6.91 KB 0644
gentoo.cpython-36.pyc File 6.91 KB 0644
mariner.cpython-36.opt-1.pyc File 1.54 KB 0644
mariner.cpython-36.pyc File 1.54 KB 0644
miraclelinux.cpython-36.opt-1.pyc File 316 B 0644
miraclelinux.cpython-36.pyc File 316 B 0644
net_util.cpython-36.opt-1.pyc File 1.84 KB 0644
net_util.cpython-36.pyc File 1.84 KB 0644
netbsd.cpython-36.opt-1.pyc File 4.58 KB 0644
netbsd.cpython-36.pyc File 4.58 KB 0644
networking.cpython-36.opt-1.pyc File 12.21 KB 0644
networking.cpython-36.pyc File 12.21 KB 0644
openbsd.cpython-36.opt-1.pyc File 2.26 KB 0644
openbsd.cpython-36.pyc File 2.26 KB 0644
openeuler.cpython-36.opt-1.pyc File 538 B 0644
openeuler.cpython-36.pyc File 538 B 0644
openmandriva.cpython-36.opt-1.pyc File 318 B 0644
openmandriva.cpython-36.pyc File 318 B 0644
opensuse-leap.cpython-36.opt-1.pyc File 321 B 0644
opensuse-leap.cpython-36.pyc File 321 B 0644
opensuse-microos.cpython-36.opt-1.pyc File 324 B 0644
opensuse-microos.cpython-36.pyc File 324 B 0644
opensuse-tumbleweed.cpython-36.opt-1.pyc File 327 B 0644
opensuse-tumbleweed.cpython-36.pyc File 327 B 0644
opensuse.cpython-36.opt-1.pyc File 6.28 KB 0644
opensuse.cpython-36.pyc File 6.28 KB 0644
photon.cpython-36.opt-1.pyc File 4.31 KB 0644
photon.cpython-36.pyc File 4.31 KB 0644
rhel.cpython-36.opt-1.pyc File 4.82 KB 0644
rhel.cpython-36.pyc File 4.82 KB 0644
rhel_util.cpython-36.opt-1.pyc File 969 B 0644
rhel_util.cpython-36.pyc File 969 B 0644
rocky.cpython-36.opt-1.pyc File 309 B 0644
rocky.cpython-36.pyc File 309 B 0644
sle-micro.cpython-36.opt-1.pyc File 317 B 0644
sle-micro.cpython-36.pyc File 317 B 0644
sle_hpc.cpython-36.opt-1.pyc File 315 B 0644
sle_hpc.cpython-36.pyc File 315 B 0644
sles.cpython-36.opt-1.pyc File 312 B 0644
sles.cpython-36.pyc File 312 B 0644
suse.cpython-36.opt-1.pyc File 312 B 0644
suse.cpython-36.pyc File 312 B 0644
ubuntu.cpython-36.opt-1.pyc File 1.45 KB 0644
ubuntu.cpython-36.pyc File 1.45 KB 0644
ug_util.cpython-36.opt-1.pyc File 3.91 KB 0644
ug_util.cpython-36.pyc File 3.91 KB 0644
virtuozzo.cpython-36.opt-1.pyc File 313 B 0644
virtuozzo.cpython-36.pyc File 313 B 0644