- handle the case where the mantisbt is not available

Sun, 25 May 2014 15:24:07 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 25 May 2014 15:24:07 +0300
changeset 3
53486417a8e5
parent 2
1a24dd2d598e
child 4
bd9508f8a10f

- handle the case where the mantisbt is not available

cobalt.py file | annotate | diff | comparison | revisions
--- a/cobalt.py	Fri May 23 19:25:37 2014 +0300
+++ b/cobalt.py	Sun May 25 15:24:07 2014 +0300
@@ -55,10 +55,16 @@
 #
 # SOAP stuff
 #
-suds_import = Import ('http://schemas.xmlsoap.org/soap/encoding/', \
-	'http://schemas.xmlsoap.org/soap/encoding/')
-suds_client = Client ('https://zandronum.com/tracker/api/soap/mantisconnect.php?wsdl', \
-	plugins=[ImportDoctor (suds_import)])
+suds_active = False
+
+try:
+	suds_import = Import ('http://schemas.xmlsoap.org/soap/encoding/', \
+		'http://schemas.xmlsoap.org/soap/encoding/')
+	suds_client = Client ('https://zandronum.com/tracker/api/soap/mantisconnect.php?wsdl', \
+		plugins=[ImportDoctor (suds_import)])
+	suds_active = True
+except Exception:
+	pass
 
 #
 # irc_client flags
@@ -219,6 +225,9 @@
 			control ("Recieved bad PRIVMSG: %s" % line)
 
 	def get_ticket_data (self, replyto, ticket, withlink):
+		if suds_active == False:
+			return
+
 		data = {}
 		try:
 			data = suds_client.service.mc_issue_get (g_config['trackeruser'], g_config ['trackerpassword'], ticket)

mercurial