%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2599/usr/lib/python3/dist-packages/cloudinit/distros/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2599/usr/lib/python3/dist-packages/cloudinit/distros/__pycache__/arch.cpython-38.pyc

U

Ӈg��@stddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
mZe�e�ZGdd�dej�ZdS)	�N)�distros�helpers�subp�util)�PackageList)�HostnameConf)�CLOUDINIT_NETPLAN_FILE)�
PER_ALWAYS�PER_INSTANCEc@s�eZdZdZdgZdeddd�iZdd�Zd!d
d�Ze	d�d
d�Z
dd�Zdd�Zdd�Z
d"dd�Zdd�Zdd�Zd#dd�Zdd�dd �Zd	S)$�Distroz/etc/locale.genZ	systemctlZnetplanz# generated by cloud-init
T)Znetplan_pathZnetplan_headerZpostcmdscCs0tj�||||�t�|�|_d|_d|d<dS)NZarchZsshdZssh_svcname)rr�__init__rZRunners�_runnerZosfamily)�self�nameZcfg�paths�r�8/usr/lib/python3/dist-packages/cloudinit/distros/arch.pyrszDistro.__init__NcCsj|dk	r|dkrt�d|�t��d|dg}t�|jd�|��tjdgdd�tjd	d
|gdd�dS)Nz/etc/locale.confzFInvalid locale_configfile %s, only supported value is /etc/locale.confz%s UTF-8��
z
locale-genF�ZcaptureZ	localectlz
set-locale)�LOGZwarningrZmake_header�
write_file�
locale_gen_fn�joinr)rZlocaleZout_fn�linesrrr�apply_locale&s��zDistro.apply_locale)�pkglistcCs|��|jd|d�dS)Nr)�pkgs)�update_package_sources�package_command)rrrrr�install_packages9szDistro.install_packagescCs~d}z|�|�}Wn:tk
rLt�|jdd�}|r8nt�d�YdSYnX|sZtd�}|�|�tj	|t
|�ddd�dS)N�create_hostname_fileTz8create_hostname_file is False; hostname file not createdr�wi�)Zomode�mode)�_read_hostname_conf�IOErrorrZget_cfg_option_boolZ_cfgr�inforZset_hostnamer�str)r�hostname�filename�confr!rrr�_write_hostname=s&��
zDistro._write_hostnamecCs|�|j�}|j|fS�N)�_read_hostnameZhostname_conf_fn)rZsys_hostnamerrr�_read_system_hostnameSszDistro._read_system_hostnamecCstt�|��}|��|Sr,)rrZload_text_file�parse)rr)r*rrrr$WszDistro._read_hostname_confcCs:d}z|�|�}|j}Wntk
r,YnX|s6|S|Sr,)r$r(r%)rr)�defaultr(r*rrrr-\s

zDistro._read_hostnamecCsLt�d|�zt�ddd|g�Wn$tjk
rFt�td|�YnXdS)Nz2Non-persistently setting the system hostname to %sZhostnamectlz--transientzset-hostnamez;Failed to non-persistently adjust the system hostname to %s)r�debugrZProcessExecutionErrorrZlogexc)rr(rrr�_apply_hostnameis��zDistro._apply_hostnamecCstj||�|�d�dS)N)�tzZtz_file)rZset_etc_timezoneZ
_find_tz_file)rr3rrr�set_timezonevszDistro.set_timezonecCs�|dkrg}ddddg}|r2t|t�r2|�|�n|rJt|t�rJ|�|�|dkrVd}|rd|�|�t�d|�}|�|�tj|dd	�dS)
NZpacmanz-Syz--quietz--noconfirmZupgradez-uz%s-%sFr)�
isinstancer'�append�list�extendrZexpand_package_listr)rZcommand�argsr�cmdrrrrrys


zDistro.package_commandF)�forcecCs$|jjd|jdg|rtntd�dS)Nzupdate-sourcesz-y)Zfreq)r
�runrr	r
)rr;rrrr�s
�zDistro.update_package_sources)N)N)NN)�__name__�
__module__�__qualname__rZinit_cmdrZrenderer_configsrrrr r+r.r$r-r2r4rrrrrrrs&��	




r)ZloggingZ	cloudinitrrrrZcloudinit.distrosrZ"cloudinit.distros.parsers.hostnamerZcloudinit.net.netplanrZcloudinit.settingsr	r
Z	getLoggerr=rrrrrr�<module>s


Zerion Mini Shell 1.0