Your IP : 216.73.217.13


Current Path : /usr/lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_byobu.cpython-38.pyc

U

�Ad��	@s�UdZddlmZddlmZmZddlmZddlm	Z	ddl
mZmZddl
mZddlmZd	Zd
dgZdd
deeeddggd�Zeed<ee�Zee	eeedd�dd�ZdS)z=Byobu: Enable/disable byobu system wide and for default user.�)�Logger)�subp�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�ug_util)�PER_INSTANCEa�This module controls whether byobu is enabled or disabled system wide and for
the default system user. If byobu is to be enabled, this module will ensure it
is installed. Likewise, if it is to be disabled, it will be removed if
installed.

Valid configuration options for this module are:

  - ``enable-system``: enable byobu system wide
  - ``enable-user``: enable byobu for the default user
  - ``disable-system``: disable byobu system wide
  - ``disable-user``: disable byobu for the default user
  - ``enable``: enable byobu both system wide and for default user
  - ``disable``: disable byobu for all users
  - ``user``: alias for ``enable-user``
  - ``system``: alias for ``enable-system``
ZubuntuZdebianZcc_byobuZByobuz5Enable/disable byobu system wide and for default userzbyobu_by_default: enable-userz byobu_by_default: disable-system)�id�name�titleZdescription�distrosZ	frequencyZexamplesZactivate_by_schema_keys�metaN)r�cfg�cloud�log�args�returncCs\t|�dkr|d}nt�|dd�}|s8|�d|�dS|dksH|dkrPd|}d}||krh|�d	|�|�d
�}|�d�}|�d�r�d
}	d}
d}n|dkr�d}d}d}	d}
d}|r�t�||j	�\}}
t�
|�\}}|s�|�d|	�n|d||	f7}|d7}|�r |d|
7}|d7}|d7}t|��rXdddd|dfg}|�d|�tj|dd�dS) NrZbyobu_by_default�z1Skipping module named %s, no 'byobu' values found�user�systemz	enable-%s)zenable-userz
enable-system�enablezdisable-userzdisable-system�disablez%Unknown value %s for byobu_by_defaultz-userz-systemr�installz*byobu byobu/launch-by-default boolean trueTrZ	uninstallz+byobu byobu/launch-by-default boolean falsezFNo default byobu user provided, can not launch %s for the default userz  sudo -Hu "%s" byobu-launcher-%sz || X=$(($X+1)); z"echo "%s" | debconf-set-selectionsz4 && dpkg-reconfigure byobu --frontend=noninteractivez/bin/shz-cz%s %s %szX=0;zexit $XzSetting byobu to %sF)Zcapture)�lenrZget_cfg_option_str�debugZwarning�endswith�
startswithr	Znormalize_users_groupsZdistroZextract_defaultr)rrrrr�valueZvalidZmod_userZmod_sysZbl_instZdc_valZshcmdZusersZ_groupsrZ_user_config�cmd�r!�;/usr/lib/python3/dist-packages/cloudinit/config/cc_byobu.py�handle8sR



�
r#)�__doc__ZloggingrZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.distrosr	Zcloudinit.settingsr
ZMODULE_DESCRIPTIONrr�__annotations__�str�listr#r!r!r!r"�<module>	s8���