Mini Shell

Direktori : /usr/lib64/python3.6/site-packages/pyanaconda/payload/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/pyanaconda/payload/__pycache__/base.cpython-36.opt-1.pyc

3

C��e �@sxddlZddlmZmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
e
e�ZdgZGd	d�ded
�ZdS)�N)�ABCMeta�abstractmethod)�conf)�util)�kernel_arguments)�PayloadRequirements)�get_module_logger�Payloadc@s�eZdZdZdd�Zdd�Zeedd���Zdd	�Z	ed
d��Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zedd��Zdd�Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zd&d'�Zd(d)�Zed*d+��Zed,d-��Zd.d/�Zd0d1�Zd2S)3r	z=Payload is an abstract class for OS install delivery methods.cCs"||_g|_tj�|_t�|_dS)zjInitialize Payload class

        :param data: This param is a kickstart.AnacondaKSHandler class.
        N)�data�verbose_errorsrZrequests_sessionZ_sessionr�requirements)�selfr
�r�/usr/lib64/python3.6/base.py�__init__#s
zPayload.__init__cCsdS)zhSet the payload from the Anaconda cmdline options.

        :param opts: a namespace of options
        Nr)r
Zoptsrrr�
set_from_opts2szPayload.set_from_optscCsdS)zThe DBus type of the payload.Nr)r
rrr�type9szPayload.typecCsdS)a6Get the DBus proxy of the installation source (if any).

        There may be payloads that do not have an installation source
        and thus also no source proxy. It is still beter to define
        this method also for those payloads and have it return None.

        :return: a DBus proxy or None
        Nr)r
rrr�get_source_proxy?s	zPayload.get_source_proxycCsdS)zThe DBus type of the source.Nr)r
rrr�source_typeJszPayload.source_typecCsdS)zIs the payload ready?Tr)r
rrr�is_readyOszPayload.is_readycCs
g|_dS)zDo any payload-specific setup.N)r)r
rrr�setupSsz
Payload.setupcCsdS)z&Invalidate a previously setup payload.Nr)r
rrr�unsetupWszPayload.unsetupcCsdS)z�Run specific payload post-configuration tasks on the end of
        the restart_thread call.

        This method could be overriden.
        Nr)r
rrr�
post_setup[szPayload.post_setupcCsdS)z�Release any resources in use by this object, but do not do final
        cleanup.  This is useful for dealing with payload backends that do
        not get along well with multithreaded programs.
        Nr)r
rrr�releasecszPayload.releasecCsdS)z)Reset the instance, not including ksdata.Nr)r
rrr�resetjsz
Payload.resetcCsdS)NFr)r
rrr�
needs_networknszPayload.needs_networkcCsdS)ziIs the given language supported by the payload?

        :param language: a name of the language
        Tr)r
�languagerrr�is_language_supportedrszPayload.is_language_supportedcCsdS)z�Is the given locale supported by the payload?

        :param language: a name of the language
        :param locale: a name of the locale
        Tr)r
rZlocalerrr�is_locale_supportedyszPayload.is_locale_supportedcCsgS)Nr)r
rrr�language_groups�szPayload.language_groupscCsgS)Nr)r
rrr�	langpacks�szPayload.langpackscCs
t��dS)z?The total disk space (Size) required for the current selection.N)�NotImplementedError)r
rrr�space_required�szPayload.space_requiredcCs
t��dS)z<An iterable of the kernel versions installed by the payload.N)r!)r
rrr�kernel_version_list�szPayload.kernel_version_listcCs ddlm}|tjj�j�dS)zPerform pre-installation tasks.r)� PrepareSystemForInstallationTaskN)�/pyanaconda.modules.payloads.base.initializationr$r�target�system_root�run)r
r$rrr�pre_install�szPayload.pre_installcCs
t��dS)zInstall the payload.N)r!)r
rrr�install�szPayload.installcCsdS)z�Should we write the storage before doing the installation?

        Some payloads require that the storage configuration will be written out
        before doing installation. Right now, this is basically just the dnfpayload.
        Fr)r
rrr�needs_storage_configuration�sz#Payload.needs_storage_configurationcCsdS)z�Whether this payload backend writes the bootloader configuration itself; if
        False (the default), the generic bootloader configuration code will be used.
        Fr)r
rrr� handles_bootloader_configuration�sz(Payload.handles_bootloader_configurationc	Cs�tjjtjjd�rd}ntjd�d}x�|jD]�}tj	d|�tjj
s�|rttjdd|g�tjdd	d
||g�ntjddd
dd|g�t
jd�dkr�tjdddg�q0tjddddd	d
||g�q0WdS)z�Recreate the initrds by calling new-kernel-pkg or dracut

        This needs to be done after all configuration files have been
        written, since dracut depends on some of them.

        :returns: None
        z/usr/sbin/new-kernel-pkgFz4new-kernel-pkg does not exist, using dracut instead.Tzrecreating initrd for %sZdepmodz-aZdracutz-fz/boot/initramfs-%s.imgznew-kernel-pkgz
--mkinitrdz--dracutz--depmodz--updateZfips�1zfips-mode-setupz--enablez--no-bootcfgz-Nz--persistent-policyzby-uuidN)�os�path�existsrr&r'�log�debugr#�infoZis_imagerZ
execInSysrootr�get)r
Z
use_dracutZkernelrrr�recreate_initrds�s.


zPayload.recreate_initrdscCs@ddlm}|tjj�j�tjd|j�|jj	s<tjd�dS)z Perform post-installation tasks.r)�CopyDriverDisksFilesTaskzInstallation requirements: %sz*Some of the requirements were not applied.N)
r%r6rr&r'r(r1r3rZapplied)r
r6rrr�post_install�s
zPayload.post_installN)�__name__�
__module__�__qualname__�__doc__rr�propertyrrrrrrrrrrrrrrr r"r#r)r*r+r,r5r7rrrrr	!s4	.)�	metaclass)r.�abcrrZ&pyanaconda.core.configuration.anacondarZpyanaconda.corerZpyanaconda.core.kernelrZpyanaconda.payload.requirementrZpyanaconda.anaconda_loggersrr8r1�__all__r	rrrr�<module>s