# HG changeset patch # User Santeri Piippo # Date 1401020647 -10800 # Node ID 53486417a8e5dd6ebad5ea045a2db9cfe5b09a1f # Parent 1a24dd2d598e963dc4b8d540d67da0267776acab - handle the case where the mantisbt is not available diff -r 1a24dd2d598e -r 53486417a8e5 cobalt.py --- 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)