[bts-link] 01/02: Improve crash report in case of rate limiting on Jira SOAP API endpoint
Olivier Berger
obergix at moszumanska.debian.org
Tue Dec 8 10:03:56 UTC 2015
This is an automated email from the git hooks/post-receive script.
obergix pushed a commit to branch obergix-master
in repository bts-link.
commit cc161f3262df50c0c0f705ac482a4e31975228f7
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date: Tue Dec 8 10:58:39 2015 +0100
Improve crash report in case of rate limiting on Jira SOAP API endpoint
---
remote/base.py | 2 +-
remote/jira.py | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/remote/base.py b/remote/base.py
index d46aa51..1bd79e5 100644
--- a/remote/base.py
+++ b/remote/base.py
@@ -27,7 +27,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
-import sys, os, re, time, traceback
+import sys, os, re, time, traceback, signal
makeToken_re = re.compile(r"[^a-zA-Z0-9 at .+\-]")
diff --git a/remote/jira.py b/remote/jira.py
index 058d173..008046f 100644
--- a/remote/jira.py
+++ b/remote/jira.py
@@ -17,6 +17,7 @@
import SOAPpy
from __init__ import *
+from base import die
class JIRAData:
def __init__(self, bts, id):
@@ -48,8 +49,12 @@ class RemoteJIRA(RemoteBts):
try:
self.auth = self.soap.login('bts-link', 'bts-link')
except:
- # mainly for puppet
- self.auth = self.soap.login('bts-link', 'mQJ1lEYaHcsoU')
+ # mainly for puppet (tickets.puppetlabs.com)
+ try:
+ self.auth = self.soap.login('bts-link', 'mQJ1lEYaHcsoU')
+ except SOAPpy.Types.faultType as e:
+ # Make sure to notify which Jira server refused login.
+ die('could not login to %s : %s!' % (uri, str(e)))
self.status_map = {}
for status in self.soap.getStatuses(self.auth):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bts-link/bts-link.git
More information about the bts-link-commits
mailing list