ó uÈÔec@s”ddlmZddlZddlZddlmZmZddlmZm Z ddl m Z defd„ƒYZ de fd „ƒYZdS( iÿÿÿÿ(tprint_functionN(t RedHatPlugint SuSEPlugin(t LinuxPolicytPackageManager(t_sost SuSEPolicycBsVeZdZdZdZdZdd„Zed„ƒZ d„Z d„Z d„Z RS( tSuSEshttps://www.suse.com/s/var/tmpcCsµtt|ƒjƒd|_tdƒ|_ttg|_|jj ƒ}|srt ddt j ƒt j dƒnd|_|jtjd7_|jtjd7_|jƒdS( Nts,rpm -qa --queryformat "%{NAME}|%{VERSION}\n"s'Could not obtain installed package listtfileis/usr/sbin:/usr/bin:/root/bins/usr/local/bins/usr/local/sbin(tsuperRt__init__t ticket_numberRtpackage_managerRRtvalid_subclassestall_pkgstprinttsyststderrtexittPATHtostpathsept set_exec_path(tselftsysroottpkgs((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyR s   cCstS(sÑThis 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.(tFalse(tcls((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pytcheck-sc Cs×ddlm}m}g}|d|dtd|d|dddtƒ}|jƒ\}}|rf|Sxj|jƒd D]X}y|jd d ƒ\} } Wntk r¬qwX| d krw|jt| ƒƒqwqwW|S( Niÿÿÿÿ(tPopentPIPEs"LC_ALL=C /sbin/chkconfig --list %stshelltstdoutRtbufsizet close_fdsit:ton( t subprocessRRtTruet communicatetsplitt IndexErrortappendtint( RtnameRRtrettptoutterrttabstrunleveltonoff((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pytrunlevel_by_service4s&    cCs|s |jS|S(N(t_tmp_dir(Rt opt_tmp_dir((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyt get_tmp_dirJscCs |jƒS(N(t host_name(R((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pytget_local_nameOsN( t__name__t __module__tdistrotvendort vendor_urlR6tNoneR t classmethodRR5R8R:(((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyRs   tOpenSuSEPolicycBsAeZdZdZdZedƒZdd„Ze d„ƒZ RS(tOpenSuSERshttps://www.opensuse.org/sJThis command will collect diagnostic and configuration information from this %(distro)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 cCstt|ƒjd|ƒdS(NR(R RBR (RR((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyR dscCstjjdƒS(s=This method checks to see if we are running on SuSE. s/etc/SuSE-release(Rtpathtisfile(R((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyRgsN( R;R<R=R>R?t_tmsgR@R RAR(((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyRBSs  (t __future__RRRt sos.pluginsRRt sos.policiesRRtsosRRFRRB(((s5/usr/lib/python2.7/site-packages/sos/policies/suse.pyt s  ?