403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/bugzilla/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyc
Ic@smddkZddklZddkZddkZdeiifdYZdeefdYZ	dS(iN(t
Bugzilla34t
RHBugzillacBsNeZdZdZeiideZdZdZdZ	dZ
dZdZd	Z
d
ZdZd!dZd
ZdZdZdZdZeddddZdeeedZdZdZdZdedZdZdZdZ dZ!dZ"dZ#dZ$d Z%RS("sConcrete implementation of the Bugzilla protocol. This one uses the
    methods provided by Red Hat's Bugzilla 2.18 variant.

    RHBugzilla supports XMLRPC MultiCall. The methods which start with a
    single underscore are thin wrappers around XMLRPC methods and should thus
    be safe for multicall use.

    Documentation for most of these methods can be found here:
    https://bugzilla.redhat.com/docs/en/html/api/extensions/compat_xmlrpc/code/webservice.html
    s0.2s RHBugzilla/%scKs)tiii|||ii|_dS(N(tbugzillatbasetBugzillaBaset__init__t	__class__t
user_agent(tselftkwargs((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRscCs|iii||S(s$Backend login method for RHBugzilla.(t_proxyRtlogin(Rtusertpassword((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_login#scCstS(s%Backend logout method for RHBugzilla.(tTrue(R((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_logout'scs@ti|ti|i_fd}|_S(sThis returns kind of a mash-up of the Bugzilla object and the 
        xmlrpclib.MultiCall object. Methods you call on this object will be
        added to the MultiCall queue, but they will return None. When you're
        ready, call the run() method and all the methods in the queue will be
        run and the results of each will be returned in a list. So, for example:

        mc = bz._multicall()
        mc._getbug(1)
        mc._getbug(1337)
        mc._query({'component':'glibc','product':'Fedora','version':'devel'})
        (bug1, bug1337, queryresult) = mc.run()

        Note that you should only use the raw xmlrpc calls (mostly the methods
        starting with an underscore). Normal getbug(), for example, tries to
        return a _Bug object, but with the multicall object it'll end up empty
        and, therefore, useless.

        Further note that run() returns a list of raw xmlrpc results; you'll
        need to wrap the output in Bug objects yourself if you're doing that
        kind of thing. For example, Bugzilla.getbugs() could be implemented:

        mc = self._multicall()
        for id in idlist:
            mc._getbug(id)
        rawlist = mc.run()
        return [_Bug(self,dict=b) for b in rawlist]
        cs
iiS(N(R
tresults((tmc(s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pytrunNs(tcopyt	xmlrpclibt	MultiCallR
R(RR((Rs7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_multicall0s
	cCs|iiiS(N(R
RtgetBugFields(R((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_getbugfieldsSscCs|iiiS(N(R
RtgetQueryInfo(R((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_getqueryinfoUscCsk|iii}d}g}xF|iD]8\}}|ih|d6|d6|d6|d7}q+W|S(sBackend _getproducts method for RH Bugzilla. This predates the
        Bugzilla3 Products stuff, so we need to massage this data to make it
        fit the proper formatitidtnametdescriptioni(R
RtgetProdInfot	iteritemstappend(RtrtntprodRtdesc((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getproductsWs
"cCs9t|tjo|i|}n|iii|S(N(ttypetintt_product_id_to_nameR
RtgetProdCompInfo(Rtproduct((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getcomponentscscCs9t|tjo|i|}n|iii|S(N(R'R(R)R
RtgetProdCompDetails(RR+((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getcomponentsdetailsgscCs|i}|i|i|i|o|i||i|n|i}|id\|_|_	|id|_
|id|_|o0|id|i|<|id|i
|<ndS(sThis is a convenience method that does getqueryinfo, getproducts, 
        and (optionally) getcomponents in one big fat multicall. This is a bit 
        faster than calling them all separately. 

        If you're doing interactive stuff you should call this, with the 
        appropriate product name, after connecting to Bugzilla. This will 
        cache all the info for you and save you an ugly delay later on.iN(RRR&RR,R.Rtpopt
_querydatat_querydefaultst	_productst
_bugfieldst_componentst_components_details(RR+RR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt	_get_infoks



cCs|iii|S(s3Return a dict of full bug info for the given bug id(R
RtgetBug(RR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getbugscCsK|iii|}|o'd|jotidd|n|SdS(s;Return a short dict of simple bug info for the given bug idtbug_idtServersCould not load bug %sN(R
RtgetBugSimpleRtFault(RRR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_getbugsimplescCsI|i}x|D]}|i|qW|i}~tii|S(sLike _getbug, but takes a list of ids and returns a corresponding
        list of bug objects. Uses multicall for awesome speed.(RR8RRRtreplace_getbug_errors_with_None(RtidlistRRtraw_results((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getbugsscCsI|i}x|D]}|i|qW|i}~tii|S(sLike _getbugsimple, but takes a list of ids and returns a
        corresponding list of bug objects. Uses multicall for awesome speed.(RR=RRRR>(RR?RRR@((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_getbugssimplescCs|iii|S(sQuery bugzilla and return a list of matching bugs.
        query must be a dict with fields like those in in querydata['fields'].
        Returns a dict like this: {'bugs':buglist,
                                   'displaycolumns':columnlist,
                                   'sql':querystring}
        buglist is a list of dicts describing bugs. You can specify which 
        columns/keys will be listed in the bugs by setting 'column_list' in
        the query; otherwise the default columns are used (see the list in
        querydefaults['default_column_list']). The list of columns will be
        in 'displaycolumns', and the SQL query used by this query will be in
        'sql'. 
        (R
RtrunQuery(Rtquery((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_querys
tc	Cs+|iii|||id||||S(sAdd a comment to the bug with the given ID. Other optional 
        arguments are as follows:
            private:   if True, mark this comment as private.
            timestamp: comment timestamp, in the form "YYYY-MM-DD HH:MM:SS"
            worktime:  amount of time spent on this comment (undoc in upstream)
            bz_gid:    if present, and the entire bug is *not* already private
                       to this group ID, this comment will be marked private.
        RF(R
Rt
addCommentR(RRtcommenttprivatet	timestamptworktimetbz_gid((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_addcomments
c	Cs+|iii|||id||||S(sSet the status of the bug with the given ID. You may optionally
        include a comment to be added, and may further choose to mark that
        comment as private.
        The status may be anything from querydefaults['bug_status_list'].
        Common statuses: 'NEW','ASSIGNED','MODIFIED','NEEDINFO'
        Less common: 'VERIFIED','ON_DEV','ON_QA','REOPENED'
        'CLOSED' is not valid with this method; use closebug() instead.
        RF(R
RtchangeStatusR(RRtstatusRHRIt
private_in_ittnomail((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_setstatuss	c		Cs1|iii|||id||||||
S(sRaw xmlrpc call for closing bugs. Documentation from Bug.pm is
        below. Note that we drop the username and password fields because the
        Bugzilla object contains them already.

        closeBug($bugid, $new_resolution, $username, $password, $dupeid,
            $new_fixed_in, $comment, $isprivate, $private_in_it, $nomail)

        Close a current Bugzilla bug report with a specific resolution. This will eventually be done in Bugzilla/Bug.pm 
        instead and is meant to only be a quick fix. Please use bugzilla.changesStatus to changed to an opened state.
        This method will change the bug report's status to CLOSED.

            $bugid 
                # ID of bug report to add comment to.
            $new_resolution
                # Valid Bugzilla resolution to transition the report into. 
                # DUPLICATE requires $dupeid to be passed in.
            $dupeid
                # Bugzilla report ID that this bug is being closed as 
                # duplicate of. 
                # Requires $new_resolution to be DUPLICATE.
            $new_fixed_in
                # OPTIONAL String representing version of product/component 
                # that bug is fixed in.
            $comment
                # OPTIONAL Text string containing comment to add.
            $isprivate
                # OPTIONAL Whether the comment will be private to the 
                # 'private_comment' Bugzilla group. 
                # Default: false
            $private_in_it 
                # OPTIONAL if true will make the comment private in 
                # Issue Tracker
                # Default: follows $isprivate
            $nomail 
                # OPTIONAL Flag that is either 1 or 0 if you want email to be sent or not for this change
        RF(R
RtcloseBugR(	RRt
resolutiontdupeidtfixedinRHt	isprivateRPRQ((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt	_closebugs%cKs|iii||S(sRaw xmlrpc call to set one of the assignee fields on a bug.
        changeAssignment($id, $data, $username, $password)
        data: 'assigned_to','reporter','qa_contact','comment'
        returns: [$id, $mailresults](R
RtchangeAssignment(RRtdata((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_setassigneesc	Csg}|djo|djnh|d6|d6dd6dd6}x.|D]&}||d<|iii||qJWd|d<x.|D]&}||d<|iii||qWdS(	supdate the deps (blocked/dependson) for the given bug.
        blocked/dependson: list of bug ids/aliases
        action: 'add' or 'delete'

        RHBZ call:
        updateDepends($bug_id,$data,$username,$password,$nodependencyemail)
        #data: 'blocked'=>id,'dependson'=>id,'action' => ('add','remove')

        RHBZ only does one bug at a time, so this method will loop through
        the blocked/dependson lists. This may be slow.
        tdeletetremoveRtactionRFtblockedt	dependsonN(R
Rt
updateDepends(	RRR_R`R^R"RZtbtd((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_updatedepss
"


cCss|djo
d}n|djo
d}nh|d6|d6di|d6|d	6|d
6}|iii|S(s>Updates the CC list using the action and account list specified.
        cclist must be a list (not a tuple!) of addresses.
        action may be 'add', 'delete', or 'overwrite'.
        comment specifies an optional comment to add to the bug.
        if mail is True, email will be generated for this change.
        R\R]t	overwritet	makeexactRR^t,tccRHRQ(tjoinR
RtupdateCC(RRtcclistR^RHRQRZ((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt	_updateccs



!cCs1h|d6|d6|d6}|iii||S(sUpdate the whiteboard given by 'which' for the given bug.
        performs the given action (which may be 'append',' prepend', or 
        'overwrite') using the given text.R'ttextR^(R
RtupdateWhiteboard(RRRmtwhichR^RZ((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_updatewhiteboard&scCs|iii||S(sUpdates the flags associated with a bug report.
        data should be a hash of {'flagname':'value'} pairs, like so:
        {'needinfo':'?','fedora-cvs':'+'}
        You may also add a "nomail":1 item, which will suppress email if set.

        NOTE: the Red Hat XMLRPC interface does not yet support setting the
        requestee (as in: needinfo from smartguy@answers.com). Alas.(R
RtupdateFlags(RRtflags((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_updateflags-scKs|iii||S(N(R
Rt
addAttachment(RRt
attachdata((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_attachfile>scKs|iii|}|dS(sRaw xmlrpc call for createBug() Doesn't bother guessing defaults
        or checking argument validity. Use with care.
        Returns bug_idi(R
Rt	createBug(RRZR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_createbugCscCs+|iii||||i|i}|S(N(R
RtupdatePermsRR
(RRR^tgroupsR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_updatepermsJscCs(|iii|||i|i}|S(N(R
RtaddUserRR
(RRRR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_adduserNs$cCsd}x8|D]0}||jp||otd|q
q
Wt|dtjo|i|d|d<n|iii||i|i}|S(NR+t	componenttinitialownerRsmandatory fields missing: %s(sproducts	componentRsdescription(	t	TypeErrorR'R(R)R
RtaddComponentRR
(RRZtadd_required_fieldstfieldR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt
_addcomponentQs!cCsd}x8|D]0}||jp||otd|q
q
Wt|dtjo|i|d|d<n|iii||i|i}|S(NRR+R~smandatory field missing: %s(sinitialownersproducts	component(	RR'R(R)R
Rt
editComponentRR
(RRZtedit_required_fieldsRR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_editcomponentZs!N(&t__name__t
__module__t__doc__tversionRRRRRRRRRR&R,R.tNoneR6R8R=RARBREtFalseRMRRRXR[RdRlRpRsRvRxR{R}RR(((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRsB
					#							
	
			'										tRHBugzilla3cBseZdZdZeiideZdZdZdZ	dZ
dZdeeed	Z
d
ZdZdZded
ZdZRS(sConcrete implementation of the Bugzilla protocol. This one uses the
    methods provided by Red Hat's Bugzilla 3.2+ instance, which is a superset
    of the Bugzilla 3.2 methods. The additional methods (Bug.search, Bug.update)
    should make their way into a later upstream Bugzilla release (probably 4.0).

    Note that RHBZ3 *also* supports most of the old RHBZ methods, under the
    'bugzilla' namespace, so we use those when BZ3 methods aren't available.

    This class was written using bugzilla.redhat.com's API docs:
    https://bugzilla.redhat.com/docs/en/html/api/

    By default, _getbugs will multicall getBug(id) multiple times, rather than
    doing a single Bug.get(idlist) call. You can disable this behavior by
    setting the 'multicall' property to False. This will make it somewhat
    faster, but any missing/unreadable bugs will cause the entire call to
    Fault rather than returning any data.
    s0.1s RHBugzilla3/%scKs>tt|i||ii|_|idt|_dS(Nt	multicall(tsuperRRRRtgetRR(RR	((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRzscCsg}|iot|djo|iii|dgS|i}x!|D]}|iii|qQW|i}~tii|}nF|ii	i
h|d6}g}|dD]}||dq~}|S(Niitidstbugst	internals(RtlenR
RR7RRRR>tBugR(RR?R"RRR@t_[1]ti((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRAs
)cCs|iii|S(sQuery bugzilla and return a list of matching bugs.
        query must be a dict with fields like those in in querydata['fields'].
        You can also pass in keys called 'quicksearch' or 'savedsearch' - 
        'quicksearch' will do a quick keyword search like the simple search
        on the Bugzilla home page. 
        'savedsearch' should be the name of a previously-saved search to
        execute. You need to be logged in for this to work.
        Returns a dict like this: {'bugs':buglist,
                                   'sql':querystring}
        buglist is a list of dicts describing bugs, and 'sql' contains the SQL
        generated by executing the search.
        (R
Rtsearch(RRD((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyREs
cCs!|iiih|d6|d6S(sUpdate the given fields with the given data in one or more bugs.
        ids should be a list of integers or strings, representing bug ids or
        aliases.
        updates is a dict containing pairs like so: {'fieldname':'newvalue'}
        Rtupdates(R
Rtupdate(RRR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_update_bugss	cCs|id|gd|S(sUpdate a single bug, specified by integer ID or (string) bug alias.
        Really just a convenience method for _update_bugs(ids=[id],updates)RR(R(RRR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt_update_bugsRFcCs<h|d6}|o||d<||d<n|i||S(s,Set the status of the bug with the given ID.t
bug_statusRHtcommentprivacy(R(RRRORHRIRPRQR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRRs


c	
Cshdd6|d6}	|od|	d<||	d<n|o||	d<n|o#||	d<|ot|	d<qrn|i||	S(	sClose the given bug. This is the raw call, and no data checking is
        done here. That's up to the closebug method.
        Note that the private_in_it and nomail args are ignored.tCLOSEDRRTt	DUPLICATEtdupe_idtfixed_inRHR(RR(
RRRTRURVRHRWRPRQR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRXs

cKsZtg}|iD]*\}}|djo|||fqq~}|i||S(sRaw xmlrpc call to set one of the assignee fields on a bug.
        changeAssignment($id, $data, $username, $password)
        data: 'assigned_to','reporter','qa_contact','comment'
        returns: [$id, $mailresults]RF(tdictR R(RRRZRtktvR((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyR[sJcCsJ|djo
tdnh|d|6|d|6}|i||dS(sUpdate the deps (blocked/dependson) for the given bug.
        blocked, dependson: list of bug ids/aliases
        action: 'add' or 'delete'
        taddR\s action must be 'add' or 'delete's
%s_blockeds%s_dependsonN(saddsdelete(t
ValueErrorR(RRR_R`R^R((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRds


cCsh}|o||d<n|d
jo"||d|<|i||nx|djoa|i|}d|jotdt|n|i||dd|i||dn
tdd	S(s>Updates the CC list using the action and account list specified.
        cclist must be a list (not a tuple!) of addresses.
        action may be 'add', 'delete', or 'overwrite'.
        comment specifies an optional comment to add to the bug.
        if mail is True, email will be generated for this change.
        RHRR\s%s_ccReRhsCan't find cc list in bug %ss-action must be 'add','delete', or 'overwrite'N(saddsdelete(RR8tAttributeErrortstrRlR(RRRkR^RHRQRR"((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRls


cCs|idp|d}nh}|djo|||<n|i|}||jotd|t|fn||}|djo|d|||<n$|djo|d|||<n|i||dS(sJUpdate the whiteboard given by 'which' for the given bug.
        performs the given action (which may be 'append',' prepend', or 
        'overwrite') using the given text.

        RHBZ3 Bug.update() only supports overwriting, so append/prepend
        may cause two server roundtrips - one to fetch, and one to update.
        t_whiteboardResNo such whiteboard %s in bug %stprependt R!N(tendswithR8RRR(RRRmRoR^RR"twb((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRps




(RRRRRRRRRARERRRRRRXR[RdRlRp(((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyRds									(
t
bugzilla.baseRt	bugzilla3RRRRRRR(((s7/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.pyt<module>s
U

Youez - 2016 - github.com/yon3zu
LinuXploit