U
    -_g                     @   sh   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl	m
Z G dd deZG dd	 d	eZdS )
    N)RedHatPlugin
SuSEPlugin)LinuxPolicy)RpmPackageManager)_sosc                       sN   e Zd ZdZdZdgZdZd fdd	Zedd	d
Z	dd Z
dd Z  ZS )
SuSEPolicySuSE)zDistribution Websitezhttps://www.suse.com/z/var/tmpNTc                    s   t  j||||d |  jttg7  _d| _t | _| jjsR| j	
d td d| _|  jtjd 7  _|  jtjd 7  _|   d S )Nsysrootinitprobe_runtimeremote_execFz(Could not obtain installed package list.   z"/usr/sbin:/usr/bin:/root/bin:/sbinz/usr/local/binz/usr/local/sbin)super__init__Zvalid_subclassesr   r   Zusrmover   Zpackage_managerZpackagesZui_logerrorsysexitPATHospathsepZset_exec_pathselfr
   r   r   r   	__class__ ;/usr/lib/python3/dist-packages/sos/policies/distros/suse.pyr      s    

zSuSEPolicy.__init__ c                 C   s   dS )zThis method checks to see if we are running on SuSE. It must be
        overriden by concrete subclasses to return True when running on an
        OpenSuSE, SLES or other Suse distribution and False otherwise.Fr   )clsZremoter   r   r   check-   s    zSuSEPolicy.checkc                 C   s   |s
| j S |S N)_tmp_dir)r   Zopt_tmp_dirr   r   r   get_tmp_dir4   s    zSuSEPolicy.get_tmp_dirc                 C   s   |   S r    )Z	host_name)r   r   r   r   get_local_name9   s    zSuSEPolicy.get_local_name)NNTN)r   )__name__
__module____qualname__os_release_namevendorvendor_urlsr!   r   classmethodr   r"   r#   __classcell__r   r   r   r   r      s     r   c                       s8   e Zd ZdZdgZdZdZedZd
 fdd		Z	  Z
S )OpenSuSEPolicyr   )zCommunity Websitezhttps://www.opensuse.org/ZOpenSuSEz/etc/SUSE-brandaS  This command will collect diagnostic and configuration information from this %(os_release_name)s system and installed applications.

An archive containing the collected information will be generated in %(tmpdir)s and may be provided to a %(vendor)s support representative.

No changes will be made to system configuration.
%(vendor_text)s
NTc                    s   t  j||||d d S )Nr	   )r   r   r   r   r   r   r   O   s    
zOpenSuSEPolicy.__init__)NNTN)r$   r%   r&   r(   r)   r'   Zos_release_file_msgr   r+   r   r   r   r   r,   =   s     r,   )r   r   Zsos.report.pluginsr   r   Zsos.policies.distrosr   Z!sos.policies.package_managers.rpmr   Zsosr   r-   r   r,   r   r   r   r   <module>
   s   *