Allow bugzilla username and password to be None and use cookie auth
For custom hooks using gitzilla.hooks.post_receive and gitzilla.hooks.update, cookie auth can be used now. The cookie file is generated by pybugz and is at ~/.bugz_cookiemaster
parent
db482dcd6d
commit
e6c1bc0b7f
6
hooks.py
6
hooks.py
|
@ -19,7 +19,8 @@ def post_receive(sBZUrl, sBZUser, sBZPasswd, sFormatSpec=None, oBugRegex=None, s
|
|||
info to the comment. If multiple bug ids are found, the comment is added
|
||||
to each of those bugs.
|
||||
|
||||
sBZUrl is the base URL for the Bugzilla installation.
|
||||
sBZUrl is the base URL for the Bugzilla installation. If sBZUser and
|
||||
sBZPasswd are None, then it uses the ~/.bugz_cookie cookiejar.
|
||||
|
||||
oBugRegex specifies the regex used to search for the bug id in the commit
|
||||
messages. It MUST provide a named group called 'bug' which contains the bug
|
||||
|
@ -133,8 +134,7 @@ def update(oBugRegex=None, asAllowedStatuses=None, sSeparator=None, sBZUrl=None,
|
|||
|
||||
if asAllowedStatuses is not None:
|
||||
# sanity checking
|
||||
for item in (sBZUrl, sBZUser):
|
||||
if item is None:
|
||||
if sBZUrl is None:
|
||||
raise ValueError("Bugzilla info required for status checks")
|
||||
|
||||
# create and cache bugzilla instance
|
||||
|
|
5
utils.py
5
utils.py
|
@ -54,9 +54,8 @@ def post_to_bugzilla(iBugId, sComment, sBZUrl, sBZUser, sBZPasswd):
|
|||
"""
|
||||
posts the comment to the given bug id.
|
||||
"""
|
||||
for item in (sBZUrl, sBZUser, sBZPasswd):
|
||||
if item is None:
|
||||
raise ValueError("Bad bugzilla info")
|
||||
if sBZUrl is None:
|
||||
raise ValueError("No Bugzilla URL specified")
|
||||
|
||||
oBZ = bugz.bugzilla.Bugz(sBZUrl, user=sBZUser, password=sBZPasswd)
|
||||
oBZ.modify(iBugId, comment=sComment)
|
||||
|
|
Loading…
Reference in New Issue