Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/

[FILE] cc_ansible.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apk_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_pipelining.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_bootcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_byobu.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ca_certs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_chef.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disable_ec2_metadata.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disk_setup.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_fan.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_final_message.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_growpart.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_grub_dpkg.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_install_hotplug.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keyboard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keys_to_console.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_landscape.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_locale.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_lxd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mcollective.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mounts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ntp.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_package_update_upgrade_install.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_phone_home.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_power_state_change.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_puppet.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_raspberry_pi.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_reset_rmc.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resizefs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resolv_conf.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rh_subscription.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rsyslog.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_runcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_salt_minion.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_boot.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_instance.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_once.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_user.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_vendor.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_seed_random.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_passwords.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_snap.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_spacewalk.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_authkey_fingerprints.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_import_id.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_timezone.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_autoinstall.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_drivers.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_pro.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_etc_hosts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_users_groups.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_wireguard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files_deferred.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_yum_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_zypper_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] modules.cpython-310.pyc [ edit | delete | rename ]
[FILE] schema.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_grub_dpkg.cpython-310.pyc

o

q��i��
@s�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	d
dge
gd�Zeed
<e�e�Zdd�Zdefdd�Zdede	dededdf
dd�Zde	defdd�ZdS)z5Grub Dpkg: Configure grub debconf installation device�N)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCE)�ProcessExecutionError�cc_grub_dpkg�ubuntu�debian)�id�distros�	frequency�activate_by_schema_keys�metac
Csbd}g}d}d}t�rd}d}ztjdd||gdd	�j��}Wn8tyI}zt|jt�r3t�	d
�nd|j
vr>t�	d�n�WYd
}~nd
}~wtyWt�
td�Ynw|r`tj�|�sbdSztjdddd|gdd	�j����}Wnty�t�
td|�Ynwt�	dd�|��dd�|D�}t�	dd�|��|r�t|�dn|}t�	d|�|S)z�
    Fetches the /dev/disk/by-id device grub is installed to.
    Falls back to plain disk name if no by-id entry is present.
    ��diskz/boot�devicez	/boot/efiz
grub-probez-tT)�capturez'grub-probe' not found in $PATHzfailed to get canonical pathz)grub-probe 'failed to get canonical path'Nz*grub-probe failed to execute for grub_dpkg�udevadm�infoz--rootz--query=symlinkz3udevadm DEVLINKS symlink query failed for disk='%s'z%considering these device symlinks: %s�,cSsg|]}d|vr|�qS)z
disk/by-id�)�.0�devrr�?/usr/lib/python3/dist-packages/cloudinit/config/cc_grub_dpkg.py�
<listcomp>Zszfetch_idevs.<locals>.<listcomp>z)filtered to these disk/by-id symlinks: %srzselected %s)�
is_efi_bootedr�stdout�stripr�
isinstance�reason�FileNotFoundError�LOG�debug�stderr�	Exceptionr�logexc�os�path�exists�split�join�sorted)r�devices�probe_target�probe_mount�e�idevsrrr�fetch_idevssX��
������r3�returnc
CsBztj�d�WSty }z
t�d|�WYd}~dSd}~ww)z4
    Check if the system is booted in EFI mode.
    z/sys/firmware/efiz7Failed to determine if system is booted in EFI mode: %sNF)r(r)r*�OSErrorr#�error)r1rrrrcs��r�name�cfg�cloud�argsc
Cs�|�d|�di��}|si}|�dd�}t�|�r"t�d||�dSt|�}t�d|�ztjdg|d�WdStyQ}zt�td	|�WYd}~dSd}~ww)
N�	grub_dpkgz	grub-dpkg�enabledTz*%s disabled by config grub_dpkg/enabled=%sz-Setting grub debconf-set-selections with '%s'zdebconf-set-selections)�dataz6Failed to run debconf-set-selections for grub_dpkg: %s)	�getr�is_falser#r$�get_debconf_configrr&r')r7r8r9r:�mycfgr<�	dconf_selr1rrr�handleos"
���rCrAcCs�t�rt�|dd�}|durt�}d|St�|dd�}|dur#t�}|�d�}|dur0|}n
t|t�s:t�|�}t|��	�}d||fS)zd
    Returns the debconf config for grub-pc or
    grub-efi depending on the systems boot mode.
    zgrub-efi/install_devicesNz+grub-pc grub-efi/install_devices string %s
zgrub-pc/install_deviceszgrub-pc/install_devices_emptyz[grub-pc grub-pc/install_devices string %s
grub-pc grub-pc/install_devices_empty boolean %s
)
rr�get_cfg_option_strr3r>r �bool�translate_bool�str�lower)rAr2�idevs_emptyrrrr@�s(�


��r@)�__doc__�loggingr(�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsr�cloudinit.subprr�__annotations__�	getLogger�__name__r#r3rErrG�listrCr@rrrr�<module>s&�
D
Upload File: