Ñò K<Ì]c@sõddklZddkZddkZddklZddklZlZddk l Z ei i ddƒy4ddklZdd klZdd klZWnnXd efd „ƒYZd efd„ƒYZdefd„ƒYZdS(iÿÿÿÿ(tprint_functionN(t RedHatPlugin(t LinuxPolicytPackageManager(t_sosis/usr/share/rhn/(t up2dateAuth(tconfig(trpclibt RedHatPolicycBsSeZdZdZdZdZd„Zed„ƒZd„Z d„Z d„Z RS(sRed Hatshttp://www.redhat.com/s/tmpcCstt|ƒiƒd|_d|_tdƒ|_tg|_|ii ƒ}|p$t ddt i ƒt i dƒnd|jot dƒt}n-|dd}|d d jotnt}|o d |_n d |_|itid 7_|itid7_|iƒdS(Nts7rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\n"s'Could not obtain installed package listtfileit filesystems;Could not find 'filesystem' package: assuming PATH settingstversionit3s/usr/sbin:/usr/bin:/root/bins'/sbin:/bin:/usr/sbin:/usr/bin:/root/bins/usr/local/bins/usr/local/sbin(tsuperRt__init__t report_namet ticket_numberRtpackage_managerRtvalid_subclassestall_pkgstprinttsyststderrtexittFalsetTruetPATHtostpathsept set_exec_path(tselftpkgstusrmovetfilesys_version((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR*s*         cCstS(sÒThis method checks to see if we are running on Red Hat. It must be overriden by concrete subclasses to return True when running on a Fedora, RHEL or other CentOS distribution or False otherwise.(R(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pytcheckJsc CsÑddkl}l}g}|d|dtd|d|dddtƒ}|iƒ\}}|o|Sxb|iƒd D]P}y|id d ƒ\} } WnqyX| d jo|it| ƒƒqyqyW|S( Niÿÿÿÿ(tPopentPIPEs"LC_ALL=C /sbin/chkconfig --list %stshelltstdoutRtbufsizet close_fdsit:ton(t subprocessR$R%Rt communicatetsplittappendtint( RtnameR$R%trettptoutterrttabstrunleveltonoff((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pytrunlevel_by_serviceQs(   cCs|p|iS|S(N(t_tmp_dir(Rt opt_tmp_dir((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyt get_tmp_dirgscCs |iƒS(N(t host_name(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pytget_local_namels( t__name__t __module__tdistrotvendort vendor_urlR:Rt classmethodR#R9R<R>(((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR$s   t RHELPolicycBsYeZdZdZdZedƒZd„Zed„ƒZ d„Z d„Z d„Z RS( sCentOS Enterprise LinuxsRed Hats"https://access.redhat.com/support/srThis 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. Any information provided to %(vendor)s will be treated in accordance with the published support policies at: %(vendor_url)s The generated archive may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party. No changes will be made to system configuration. %(vendor_text)s cCstt|ƒiƒdS(N(RRER(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR‰scCs$tiidƒotiidƒ S(sVThis method checks to see if we are running on RHEL. It returns True or False.s/etc/redhat-releases/etc/fedora-release(Rtpathtisfile(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR#ŒscCs—y‰|idƒp|idƒd}|d}|ddjodS|ddjod S|dd jod S|dd jodSWnnXtS(Nsredhat-releasesredhat-release-.*iÿÿÿÿR it4it5Servert5Clientit6it7i(RIRJ(t pkg_by_nametall_pkgs_by_name_regexR(Rtpkgtpkgname((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyt dist_version“s  cCs5y&tiitiƒƒdddSWndSXdS(NitusernameR (Rt xmlrpclibtloadsRt getSystemId(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyt rhn_username¤s  cCs|iƒp |iƒS(N(RVR=(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR>®s( R?R@RARBRCt_tmsgRRDR#RQRVR>(((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyREps    t FedoraPolicycBs;eZdZdZdZd„Zed„ƒZd„ZRS(tFedorasthe Fedora Projectshttps://fedoraproject.org/cCstt|ƒiƒdS(N(RRYR(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR¸scCstiidƒS(sXThis method checks to see if we are running on Fedora. It returns True or False.s/etc/fedora-release(RRFRG(R((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyR#»scCs1|idƒp|idƒd}t|dƒS(Nsfedora-releasesfedora-release-.*iÿÿÿÿR (RMRNR0(RRO((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pytfedora_versionÁs( R?R@RARBRCRRDR#R[(((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyRY²s  (t __future__RRRt sos.pluginsRt sos.policiesRRtsosRRWRFtinserttup2date_clientRRtrhnRRRERY(((s7/usr/lib/python2.6/site-packages/sos/policies/redhat.pyts  LB