suseapi.bugzilla

This module allows remote access to Bugzilla. It wraps XML interface to read Bugzilla and SOAP service for writing to Bugzilla.

exception suseapi.bugzilla.BugzillaError

Base class for all Bugzilla errors.

exception suseapi.bugzilla.BugzillaNotPermitted

Operation was not permitted by Bugzilla.

exception suseapi.bugzilla.BugzillaNotFound

Bug was not found.

exception suseapi.bugzilla.BugzillaInvalidBugId

Bug ID is invalid.

exception suseapi.bugzilla.BugzillaConnectionError

Failed to connect to bugzilla.

exception suseapi.bugzilla.BugzillaLoginFailed

Login failed.

exception suseapi.bugzilla.BuglistTooLarge

The search result is too long.

exception suseapi.bugzilla.BugzillaUpdateError

Error while updating bugzilla field.

class suseapi.bugzilla.Bug(bug_et, anonymous=False)
Parameters:bug_et (ElementTree instance) – Data obtained from XML interface

This class holds all data for single bug from Bugzilla. All XML elements are parsed to the Bug class attributes, so you can access them like bug.bug_severity.

class suseapi.bugzilla.Bugzilla(user, password, base='https://bugzilla.novell.com')
Parameters:
  • user (string) – Username to Bugzilla
  • password (string) – Password to Bugzilla
  • base (string) – Base URL for Bugzilla

Bugzilla communication class for read only access. With iChain authentication. The authentication part is expensive so it is good idea to remember authentication cookies and reuse them as much as possible. It is subclass of suseapi.browser.WebScraper.

login()
Throws:BugzillaLoginFailed in case login fails.

Performs login to Bugzilla.

get_bug(bugid, retry=True)
Parameters:
  • bugid (integer) – Bug id
  • retry (boolean) – Whether to retry with new login on failure
Returns:

Bug data

Return type:

Bug instance

Reads single bug from Bugzilla.

get_bugs(ids, retry=True, permissive=False, store_errors=False)
Parameters:
  • ids (list of integers) – Bug ids
  • retry (boolean) – Whether to retry with new login on failure
  • permissive (boolean) – Whether to ignore not found bugs
  • store_errors (boolean) – Whether to store bug retrieval errors in result
Returns:

Bug data

Return type:

list of Bug instances

Reads list of bugs from Bugzilla.

do_search(params):
Parameters:params (list of tuples) – URL parameters for search
Returns:List of bug ids
Return type:list of integers
Throw:BuglistTooLarge in case search result is too long.

Searches for bugs matching given criteria, you can construct the query based on the bugzilla web interface.

get_recent_bugs(startdate)
Parameters:startdate (datetime instance) – Date from which to search.
Returns:List of bug ids
Return type:list of integers
Throw:BuglistTooLarge in case search result is too long.

Gets list of bugs modified since defined date.

get_openl3_bugs()
Returns:List of bug ids
Return type:list of integers
Throw:BuglistTooLarge in case search result is too long.

Searches for bugs with openL3 in whiteboard.

get_l3_summary_bugs()
Returns:List of bug ids
Return type:list of integers
Throw:BuglistTooLarge in case search result is too long.

Searches for open bugs with L3: in summary.

get_sr(bugid)
Parameters:bugid (integer) – Bug id
Return type:list of integers

Returns list of SRs associated with given bug.

update_bug(bugid, callback=None, callback_param=None, whiteboard_add=None, whiteboard_remove=None, **kwargs)
Parameters:bugid (integer) – Bug id

Updates single bug in bugzilla.

class suseapi.bugzilla.APIBugzilla(user, password, base='https://apibugzilla.novell.com')

Wrapper around suseapi.bugzilla.Bugzilla class to use HTTP authentization instead of iChain.

class suseapi.bugzilla.DjangoBugzilla(user, password, base='https://apibugzilla.novell.com')

Wrapper around suseapi.bugzilla.APIBugzilla class to use Django logging.

suseapi.bugzilla.get_django_bugzilla()
Return type:object
Returns:DjangoBugzilla instance

Constructs DjangoBugzilla objects with cookie persistence in Django cache, so the there is no need to login on every request.