File: //lib/python3/dist-packages/cloudinit/distros/__pycache__/raspberry_pi_os.cpython-312.pyc
�
쑛h� � �r � d dl Z d dlmZ d dlmZ e j
e� Z G d� dej � Zy)� N��subp)�debianc �D � � e Zd Zdedededefd�Zd d�Zdef� fd�Z� xZS )
�Distro�layout�model�variant�optionsc �4 � t j dd|g� y)zKCurrently Raspberry Pi OS sys-mods only supports
setting the layoutz+/usr/lib/raspberrypi-sys-mods/imager_custom�
set_keymapNr )�selfr r r
r s �C/usr/lib/python3/dist-packages/cloudinit/distros/raspberry_pi_os.pyr
zDistro.set_keymap s � �
� � �=���
�
� c � � t j ddd|� g� y # t j $ r] |j d� s4t j d|� t j ddd|� d�g� Y y t j d� Y y w xY 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�keynames r �apply_localezDistro.apply_locale s� � � 5��I�I�+��&��h� �
�� �)�)� 5��?�?�8�,����8�&�A�� � �/� �*�!�(�&�)� �� � � �3�4� 5�s � �AB
�5B
�B
�returnc �� �� t �| � |fi |��}|s|S t j g d�d|i�� y# t j $ r }t j d|� Y d}~yd}~ww xY w)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__s �r r"