• File: get_kerneldebug.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyc
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 6.84 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@sddlmZddlmZmZddlmZddlmZm	Z	ddl
Z
ddljjZddl
Z
dZdZe
jdZd	efd
YZdS(i(tOption(tEmptyValueErrort_(tPlugin(tYumDownloadHelpertNoReposErrorNs!Nigel Jones <nigjones@redhat.com>s%Keith Robertson <kroberts@redhat.com>s*redhat_support_tool.plugins.getkerneldebugtGetKernelDebugPackagescBseZdZd	ZgZd	ZedZedZ	edZ
edZdZdZ
dZdZRS(
tgetkerneldebugcCs
tdS(s
        The usage statement that will be printed by OptionParser.

        Example:
            - %prog -c CASENUMBER [options] <comment text here>
        Important: %prog is a OptionParser built-in.  Use it!
        s%prog <package name>(R(tcls((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyt	get_usage's	cCstd|jS(s
        The description statement that will be printed by OptionParser.

        Example:
            - 'Use the '%s' command to add a comment to a case.'             % cls.plugin_name
        syUse the '%s' command to download available debug vmlinux images.  Wildcards are allowed.  (requires root user privileges)(Rtplugin_name(R((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pytget_desc2s		cCs td|j|j|jfS(s
        The epilog string that will be printed by OptionParser.  Usually
        used to print an example of how to use the program.

        Example:
         Examples:
          - %s -c 12345678 Lorem ipsum dolor sit amet, consectetur adipisicing
          - %s -c 12345678
        sPExamples:
  - %s 2.6.32-343.el6
  - %s 2.6.18-128.*
  - %s -t xen 2.6.18-348.el5(RR
(R((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyt
get_epilog?scCsXtdddddddtdd	ttd
ddddtd
dtdgS(sO
        Subclasses that need command line options should override this method
        and return an array of optparse.Option(s) to be used by the
        OptionParser.

        Example:
         return [Option("-f", "--file", action="store",
                        dest="filename", help='Some file'),
                 Option("-c", "--case",
                        action="store", dest="casenumber",
                        help='A case')]

         Would produce the following:
         Command (? for help): help mycommand

         Usage: mycommand [options]

         Use the 'mycommand' command to find a knowledge base solution by ID
         Options:
           -h, --help  show this help message and exit
           -f, --file  Some file
           -c, --case  A case
         Example:
          - mycommand -c 12345 -f abc.txt

        s-ns
--noprompttdesttnoprompttactiont
store_truethelps7For multi-package installs do not ask for confirmation.tdefaults-ts	--varianttvariants$Select an alternative kernel varianttmetavartVARIANT(RRtFalse(R((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pytget_optionsPscCs!|d|_|dg|_dS(s
        Allow insertion of a package object by launchhelper (when selecting
        from the list generated by list_kerneldebugs.py)
        t	yumhelpertpackageN(RtpkgAry(tselftyumdict((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyt
insert_objus
cCs|jsWt|jdks-|jdkrtdtj}|GHt|qn=|j	drd|j	d|j
f|_nd|j
|_dS(Nis"ERROR: %s requires a package name.Rskernel-%s-debuginfo-%sskernel-debuginfo-%s(t_argstlenRRtNoneRRR
t	Exceptiont_optionst_linetyumquery(Rtmsg((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyt
validate_argss	$	

cCs*ytjdkr*ttdnt|jdkrt|_|jj|jj	|j
|_|jsttd|j
dj|jj
fqnWnrtk
r}|GHnXtk
r}|GHn>tk
r%}td|}|GHtjtj|nXdS(Nis+This command requires root user privileges.sC%s was not available from any of the following yum repositories: %ss, s(ERROR: Unable to get debug packages.  %s(tostgeteuidR!RRRRRtsetup_debug_repostfind_packageR$Rtjointget_repoidsRtloggertlogtloggingtERROR(RtnreteveteR%((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pytpostinits.
		)cCs yt|jdkrtdtjjddGHx|jD]}|GHqCW|jdsttd}t|j	j
dkrtdGHdSn|jj|j}x9|D]#}td	|d
|dfGHqWntdGHWn&t
k
r}tjtj|nXdS(
NisMThe vmlinux debug images from the following packages will be extracted to: %stoptiontkern_debug_dirRsContinue (y/n)? tyt	Cancelings.Kernel vmlinux file for %s was extracted to %sRtpathsNo packages to install.(RRRtconfighelpertget_config_helpertgetR"t	raw_inputtstrtstriptlowerRtextractKernelDebugsR!R-R.R/tWARNING(RtpkgtlinetextpathstextractedpkgR3((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pytnon_interactive_actions(			

	N(t__name__t
__module__R
R RRR$tclassmethodR	RRRRR&R4RG(((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyR!s
%	
		(toptparseRt(redhat_support_tool.helpers.confighelperRRtredhat_support_tool.pluginsRt-redhat_support_tool.helpers.yumdownloadhelperRRR/thelpersR:R't
__author__t	getLoggerR-R(((sO/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/get_kerneldebug.pyt<module>s