MOON
Server: Apache
System: Linux server2.shieldcogroup.com 3.10.0-1160.119.1.el7.tuxcare.els12.x86_64 #1 SMP Fri Nov 8 05:49:38 UTC 2024 x86_64
User: jacom (1029)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //etc/leapp/repos.d/system_upgrade/common/libraries/dnfconfig.pyc
�
��ic@ssddlmZddlmZddlmZmZd�Zdd�Zd�Z	d�Z
d�Zd	�Zd
S(i����(tStopActorExecutionError(tget_source_major_version(tapitCalledProcessErrorcCs7ddg}t�dkr)|ddgS|ddgS(sU
    Return the list of leapp and leapp-repository rpms that should be preserved
    during the upgrade.

    It's list of packages that should be preserved, not what is really
    installed.

    The snactor RPM doesn't have to be installed, but if so, we have to take
    care about that too as well to prevent broken dnf transaction.
    tleapptsnactort7s
python2-leappsleapp-upgrade-el7toel8s
python3-leappsleapp-upgrade-el8toel9(R(tgeneric((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pytget_leapp_packagess
cCs)g|j||�D]}|j�^qS(sN
    Just like str.split(), but remove ambient whitespaces from all items
    (tsplittstrip(tdatatseptmaxsplittitem((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pyt_strip_splitscCs]dddg}|r9x!|D]}|d|g7}qWny|j|dt�d}WnOtk
r�}tj�jd�tdd	d
i|jd6|jd6��nXy|j	d�d
}Wn&t
k
r�tddd
|��nXi}xh||D]\}yt|dd
�\}	}
Wn-t
k
rJtj�jdj
|��nX|
||	<q�W|S(s�
    Return the dnf configuration dump of main options for the given context.

    Returns the list of lines after the line with "[main]" section
    tdnfsconfig-managers--dumps--disablepluginR	tstdouts#Cannot obtain the dnf configurationtmessages.Cannot obtain data about the DNF configurationtdetailststderrs[main]is/Invalid DNF configuration data (missing [main])t=s-Cannot parse the dnf dump correctly, line: {}(tcalltTrueRRtcurrent_loggerterrorRRRtindext
ValueErrorRtwarningtformat(tcontexttdisable_pluginstcmdtpluginRtet
main_starttoutput_datatlinetkeytval((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pyt_get_main_dump!s6
!


cCsAtt||�jdd�d�}g|D]}|r+|^q+S(s�
    Return the list of excluded packages for DNF in the given context.

    It shouldn't be used on the source system. It is expected this functions
    is called only in the target userspace container or on the target system.
    texcludett,(RR(tget(RRtpkgsti((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pyt_get_excluded_pkgsRs$cCs�djdj|��}dddd|g}|rWx!|D]}|d|g7}q:Wny|j|�Wn'tk
r�tj�jd��nXtj�jd	�d
S(si
    Configure DNF to exclude packages in the given list

    Raise the CalledProcessError on error.
    s
exclude={}R+Rsconfig-managers--saves--setopts--disableplugins Cannot set the dnf configurationsAThe DNF configuration has been updated to exclude leapp packages.N(RtjoinRRRRRtdebug(RtpkglistRR)R R!((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pyt_set_excluded_pkgs]s

cCs6ttt||�t���}t|||�dS(s|
    Ensure the leapp RPMs are excluded from any DNF transaction.

    This has to be called several times to ensure that our RPMs are not removed
    or updated (replaced) during the IPU. The action should happen inside
        - the target userspace container
        - on the host system
    So user will have to drop these packages from the exclude after the
    upgrade.
    N(tlisttsetR/RR3(RRt
to_exclude((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pytexclude_leapp_rpmsrs"N(
tleapp.exceptionsRt%leapp.libraries.common.config.versionRtleapp.libraries.stdlibRRRRR(R/R3R7(((sU/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.pyt<module>s		1