def connect(self): status = False self.session = condor.make_connection_from_urls( "None", self.url_chain) try : print "Connecting to device" status = self.session.connect(self.session_log) except Exception as e: print "Failed to connect device" print e if not status and self.stdby_nodes : for node in self.stdby_nodes : new_url_chain = self.url_chain new_url_chain[-1] = node print "Trying to connect to: ", new_url_chain[-1] self.session = condor.make_connection_from_urls( "None", new_url_chain) try : status = self.session.connect(self.session_log) except : print "Failed to connect to : ",node return status
def execute(self, ctx): global AUT_PATH csm_au_module = import_module("au.csm_au", AUT_PATH) if csm_au_module is not None: status = csm_au_module.execute(ctx) if status == 0: ctx.success = True else: try: conn = condor.make_connection_from_urls("host", ctx.urls) conn.connect() conn.disconnect() ctx.success = True except: pass
def execute(self, ctx): global AUT_PATH csm_au_module = import_module('au.csm_au', AUT_PATH) if csm_au_module is not None: status = csm_au_module.execute(ctx) if status == 0 : ctx.success = True else: try: conn = condor.make_connection_from_urls('host', ctx.urls) conn.connect() conn.disconnect() ctx.success = True except: pass