Python libraries¶
lib.tools¶
lib.bz¶
-
class
lib.bz.
Bug
(product, status, title, flags, target_rel, milestone, component, classification, external_bugs)[source]¶ Bases:
object
Bug structure
-
class
lib.bz.
Bugzilla
(user=None, passwd=None, url='https://bugzilla.redhat.com/xmlrpc.cgi')[source]¶ Bases:
object
Bugzilla Object
-
extract_bug_info
(bug_id)[source]¶ Extract parameters from bz ticket
Parameters: bug_id – bug number Return bug object: bug object that will hold all the bug data info
-
static
extract_flags
(list_of_dicts)[source]¶ Get bugzilla bug flags
Parameters: list_of_dicts – list of dict flags :return dict of flag names (key) and flag statuses (value)
-
static
get_bug_ids
(bug_urls)[source]¶ Get bug id from bug url
Parameters: bug_urls – list of bug urls Returns: set of unique bug ids
-
static
get_bug_urls
(commit, bz_server='https://bugzilla.redhat.com')[source]¶ Get bug urls from the passed commit
Parameters: - commit – commit message string
- bz_server – bugzilla server
Returns: list of bug urls or empty list
-
lib.gerrit¶
-
class
lib.gerrit.
Change
[source]¶ -
-
static
get_ci_value
(by_users=None)[source]¶ Get the global patchset CI flag value, taking into account that +1 is more prioritary than -1
Parameters: - change – dict with the change info as returned by Gerrit.query
- by_users – list of user names whose reviews will be taken into account to calculate the global value, if empty or None will not filter the reviewers
-
static
lib.config¶
Configuration¶
The cofiguration for the hooks is extracted from a hireachical structure, it will try to get the configuration, most prioritary first, from:
- ../config: that is, the parent directory of this file, in a file name config
- $GIT_DIR/hooks/config: That is (when running from gerrit) the hooks dir
inside the git repository, a file named config.
Multilines are not yet supported and the file should be bash compatible, as it might be used from bash scripts.
It’s a slightly different behavior than the bash conf.sh lib as this module is not yet finished.