diff options
author | kiko%async.com.br <> | 2004-04-14 01:52:50 +0000 |
---|---|---|
committer | kiko%async.com.br <> | 2004-04-14 01:52:50 +0000 |
commit | f57f60fd4e4cfce2351507f721c8eabc3ea33c3b (patch) | |
tree | 72338a9d8243f42f74aecbd1c3aab18e15e4301c /contrib | |
parent | Fix for bug 238869: remove %FORM from votes.cgi. Does just that, free of (diff) | |
download | bugzilla-f57f60fd4e4cfce2351507f721c8eabc3ea33c3b.tar.gz bugzilla-f57f60fd4e4cfce2351507f721c8eabc3ea33c3b.tar.bz2 bugzilla-f57f60fd4e4cfce2351507f721c8eabc3ea33c3b.zip |
Add a slightly hackish approach to test against values in .netrc that
diverge from the specified url by a trailing slash -- we *know* they're
not the same thing, but it seems people want us to think they are!
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/bugzilla-submit/bugzilla-submit | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/bugzilla-submit/bugzilla-submit b/contrib/bugzilla-submit/bugzilla-submit index 3e721f41c..d24fc3843 100755 --- a/contrib/bugzilla-submit/bugzilla-submit +++ b/contrib/bugzilla-submit/bugzilla-submit @@ -108,6 +108,16 @@ def get_credentials(bugzilla): error("missing .netrc file %s" % str(e).split()[-1]) ret = credentials.authenticators(authenticate_on) if not ret: + # Okay, the literal string passed in failed. Just to make sure, + # try adding/removing a slash after the address and looking + # again. We don't know what format was used in .netrc, which is + # why this rather hackish approach is necessary. + if bugzilla[-1] == "/": + authenticate_on = '"' + bugzilla[:-1] + '"' + else: + authenticate_on = '"' + bugzilla + '/"' + ret = credentials.authenticators(authenticate_on) + if not ret: # Apparently, an invalid machine URL will cause credentials == None error("no credentials for Bugzilla instance at %s" % bugzilla) return ret |