]> andersk Git - jira-zephyrbot.git/commitdiff
Support logging in twice (idempotently).
authorAnders Kaseorg <andersk@mit.edu>
Fri, 13 Feb 2009 08:47:44 +0000 (03:47 -0500)
committerAnders Kaseorg <andersk@mit.edu>
Fri, 13 Feb 2009 08:47:44 +0000 (03:47 -0500)
jirabot.py

index 9d36e910f01bacb6cc2e11d96fc2203e1e20dbda..7c0c7d15b2c0b6a3bb5c72e372cae5d52498c360 100755 (executable)
@@ -26,7 +26,12 @@ def jira_init():
 
 def jira_login(b):
     b.open("https://jira.mit.edu/jira/secure/Dashboard.jspa")
-    b.follow_link(text="MIT Touchstone")
+    try:
+        b.follow_link(text="MIT Touchstone")
+    except mechanize.LinkNotFoundError:
+        return
+    if (urlparse.urlparse(b.geturl())[1] == "jira.mit.edu"):
+        return
     b.select_form("wayfForm1")
     b.submit()
     b.select_form(predicate=lambda f: any(c.name == 'login_certificate'
This page took 0.032414 seconds and 5 git commands to generate.