| Server IP : 45.130.228.180 / Your IP : 216.73.217.162 Web Server : LiteSpeed System : Linux sg-nme-web1519.main-hosting.eu 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 03:40:39 EST 2025 x86_64 User : u174041621 ( 174041621) PHP Version : 8.2.30 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | 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"