From 0a091e64278a57f8dd160f9d7ab274e1c30354b9 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Sat, 14 Aug 2010 09:27:35 -0500 Subject: [PATCH] Verify a valid bugzilla cookie exists Empirical evidence suggests that you will get full names instead of email addresses for things like the assigned_to field if you haven't logged into bugzilla. While I'd prefer to have both, this does give a way to see if the bugzilla cookie is valid. So, if no '@' in the first bug's assigned_to, bail. --- scripts/process-git-requests/process-git-requests | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/process-git-requests/process-git-requests b/scripts/process-git-requests/process-git-requests index cd1e8e0..6a00a77 100755 --- a/scripts/process-git-requests/process-git-requests +++ b/scripts/process-git-requests/process-git-requests @@ -13,7 +13,6 @@ VERSION = "1.0" # Package already exists in pkgdb. # fedora-review flag isn't set (especially if it's still set to '?' # Catch common misspellings? -# Try to do some checking on the ~/.bugzillacookies file and suggest "bugzilla login" import bugzilla import codecs @@ -682,6 +681,12 @@ if __name__ == '__main__': print "Done." print + # I think this reliably detects whether or not you've logged in + if bugs[0].assigned_to.find('@') < 0: + print "It looks as if you don't have a valid bugzilla cookie." + print "Please run 'bugzilla login' and try again." + exit(1) + # Iterate over bugs for i in bugs: firstfound = True