[python-bugzilla] [PATCH] bugzilla: honor --cookiefile early so "login" follows it
Jan Pokorný
jpokorny at redhat.com
Thu Apr 18 18:43:40 UTC 2013
So far, ~/.bugzillacookies was a cookie holder regardless of what
cookiefile was specified together with "login" command.
Signed-off-by: Jan Pokorný <jpokorny at redhat.com>
---
bin/bugzilla | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/bugzilla b/bin/bugzilla
index cd518c0..53ab39b 100755
--- a/bin/bugzilla
+++ b/bin/bugzilla
@@ -900,7 +900,10 @@ def main(bzinstance=None):
if bzinstance:
bz = bzinstance
else:
- bz = bzclass(url=global_opt.bugzilla)
+ # mapping: constructor keyword -> source global_opt attribute
+ kws = {'url': 'bugzilla', 'cookiefile': 'cookiefile'}
+ kwfull = ((kw, getattr(global_opt, a, None)) for kw, a in kws.items())
+ bz = bzclass(**dict(filter(lambda (a, b): b, kwfull)))
# Handle 'login' action
--
1.8.1.4
More information about the python-bugzilla
mailing list