3 ܓi @ sh d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl m Z G dd deZG dd d eZ dS ) N)RedHatPlugin SuSEPlugin)LinuxPolicy)RpmPackageManager)_sosc sN e Zd ZdZdZdgZdZd fdd Zedd dZ dd Z dd Z ZS ) SuSEPolicySuSEDistribution Websitehttps://www.suse.com/z/var/tmpNTc s t j||||d | jttg7 _d| _t | _| jjsR| j j d tjd d| _ | j tjd 7 _ | j tjd 7 _ | j d S )N)sysrootinit probe_runtimeremote_execFz(Could not obtain installed package list. z"/usr/sbin:/usr/bin:/root/bin:/sbinz/usr/local/binz/usr/local/sbin)super__init__Zvalid_subclassesr r Zusrmover Zpackage_managerZpackagesZui_logerrorsysexitPATHospathsepZ set_exec_path)selfr r r r ) __class__ /usr/lib/python3.6/suse.pyr s zSuSEPolicy.__init__ c C s dS )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 )clsZremoter r r check- s zSuSEPolicy.checkc C s |s | j S |S )N)_tmp_dir)r Zopt_tmp_dirr r r get_tmp_dir4 s zSuSEPolicy.get_tmp_dirc C s | j S )N)Z host_name)r r r r get_local_name9 s zSuSEPolicy.get_local_name)r r )NNTN)r ) __name__ __module____qualname__os_release_namevendorvendor_urlsr r classmethodr r r! __classcell__r r )r r r s r c s8 e Zd ZdZdgZdZdZedZd fd d Z Z S ) OpenSuSEPolicyr Community Websitehttps://www.opensuse.org/ZOpenSuSEz/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 )N)r r r r )r r )r r r r r )r r r r O s zOpenSuSEPolicy.__init__)r+ r, )NNTN)r" r# r$ r&