Skip to content

Commit 82f8069

Browse files
djmitchecrobinso
authored andcommitted
support setting api_key in bugzillarc
1 parent 6cbe289 commit 82f8069

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

bugzilla/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ class Bugzilla(object):
164164
[bugzilla.yoursite.com]
165165
user = username
166166
password = password
167+
Or
168+
[bugzilla.yoursite.com]
169+
api_key = key
170+
167171
You can also use the [DEFAULT] section to set defaults that apply to
168172
any site without a specific section of its own.
169173
Be sure to set appropriate permissions on bugzillarc if you choose to
@@ -458,7 +462,10 @@ def readconfig(self, configpath=None):
458462
return
459463

460464
for key, val in cfg.items(section):
461-
if key == "user":
465+
if key == "api_key":
466+
log.debug("bugzillarc: setting api_key")
467+
self.api_key = val
468+
elif key == "user":
462469
log.debug("bugzillarc: setting user=%s", val)
463470
self.user = val
464471
elif key == "password":

0 commit comments

Comments
 (0)