]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Add a slightly hackish approach to test against values in .netrc that
authorkiko%async.com.br <>
Wed, 14 Apr 2004 01:52:50 +0000 (01:52 +0000)
committerkiko%async.com.br <>
Wed, 14 Apr 2004 01:52:50 +0000 (01:52 +0000)
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!

contrib/bugzilla-submit/bugzilla-submit

index 3e721f41cca26189e655f6c372ff53dd5dd62cc4..d24fc384338f7c8e89e00bb9da486e8223160a4c 100755 (executable)
@@ -107,6 +107,16 @@ def get_credentials(bugzilla):
     except IOError, e:
         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)