| Server IP : 185.143.233.130 / Your IP : 185.215.232.195 Web Server : LiteSpeed System : Linux jambul.7ho.st 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : renecafe ( 1327) PHP Version : 8.1.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.9/site-packages/up2date_client/__pycache__/ |
Upload File : |
a
c8h+ � @ s� d dl Z d dlZd dlZzd dlmZ dZdZdZW n eyR dZdZdZY n0 d d
� Z dd� Z
d
d� Zdd� Zdd� Z
dd� ZdS )� N)�__version__z/etc/dnf/plugins/spacewalk.confzdnf-plugin-spacewalk�dnfz$/etc/yum/pluginconf.d/rhnplugin.confzyum-rhn-pluginZyumc C sN d} d}t � r6d}t� r*t� s4t� d} qFt� d} ntj�d�rFd}|| fS )z!Enables plugin, may throw IOErrorr � z(/usr/lib/zypp/plugins/services/spacewalk)�PluginPackagePresent�PluginConfPresent�
PluginEnabled�enablePlugin�createDefaultPluginConf�os�path�exists)Zconf_changedZplugin_present� r
�;/usr/lib/python3.9/site-packages/up2date_client/pmPlugin.py�pluginEnable s r c C s t �� } | �dt�}|�� S )zO Returns positive number if plugin package is installed, otherwise it return 0 Zprovidename)�rpmZTransactionSetZdbMatch�PM_PLUGIN_NAME�count)�tsZheadersr
r
r r % s r c C s* zt �t� W dS ty$ Y dS 0 dS )z- Returns true if PM_PLUGIN_CONF is presented TFN)r
�stat�PM_PLUGIN_CONF�OSErrorr
r
r
r r + s
r c C s t td�} | �d� | �� dS )z1 Create file PM_PLUGIN_CONF, with default values �wz[main]
enabled = 1
gpgcheck = 1N)�openr �write�close)�fr
r
r r 3 s
r c C s~ t td�} | �� }| �� d}d}|D ]R}t�d|�rLt�d|�rHd}nd}|r&t�d|�}|r&t|�d��rtd}q&d}q&|S )zM Returns True if plugin is enabled
Can thrown IOError exception.
�rF�^\[.*]�^\[main]Tz^\s*enabled\s*=\s*([0-9])r )r r � readlinesr �re�match�int�group)r �lines�main_section�result�line�mr
r
r r ; s"