| Server IP : 195.114.193.97 / Your IP : 216.73.217.93 Web Server : LiteSpeed System : Linux host 5.15.0-126-generic #136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64 User : sembi4241 ( 1126) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/cloudinit/distros/__pycache__/ |
Upload File : |
o
쑛h� � @ s@ d dl Z d dlmZ d dlmZ e �e�ZG dd� dej�ZdS )� N��subp)�debianc sF e Zd Zdedededefdd�Zdd d
�Zdef� fdd
�Z� ZS )�Distro�layout�model�variant�optionsc C s t � dd|g� dS )zKCurrently Raspberry Pi OS sys-mods only supports
setting the layoutz+/usr/lib/raspberrypi-sys-mods/imager_custom�
set_keymapNr )�selfr r r r � r �C/usr/lib/python3/dist-packages/cloudinit/distros/raspberry_pi_os.pyr
s ��zDistro.set_keymapN�LANGc
C sp z
t � ddd|� g� W d S t jy7 |�d�s/t�d|� t � ddd|� d�g� Y d S t�d� Y d S w )Nz/usr/bin/raspi-config�nonint�do_change_localez.UTF-8zTrying to set locale %s.UTF-8zFailed to set locale %s)r �ProcessExecutionError�endswith�LOG�info�error)r �locale�out_fn�keynamer r r
�apply_locale s( �
�
�
� �zDistro.apply_locale�returnc
sn t � j|fi |��}|s|S ztjg d�d|id� W dS tjy6 } z
t�d|� W Y d}~dS d}~ww )z�
Add a user to the system using standard GNU tools
This should be overridden on distros where useradd is not desirable or
not available.
Returns False if user already exists, otherwise True.
)z/usr/bin/rename-userz-fz-s� SUDO_USER)�
update_envzFailed to setup user: %sNFT)�super�add_userr r r r )r �name�kwargs�result�e�� __class__r r
r 4 s �
���zDistro.add_user)Nr ) �__name__�
__module__�__qualname__�strr
r �boolr �
__classcell__r r r# r
r s
r ) �logging� cloudinitr �cloudinit.distrosr � getLoggerr% r r r r r r
�<module> s