diff --git a/erp5/util/testnode/SlapOSControler.py b/erp5/util/testnode/SlapOSControler.py index d9aa5422bedefd92fab7f97c5989eb6842bb7c73..27eea04c7d2582b3a5373ca64687acbddf96c736 100644 --- a/erp5/util/testnode/SlapOSControler.py +++ b/erp5/util/testnode/SlapOSControler.py @@ -96,15 +96,20 @@ class SlapOSControler(object): # XXX: dirty, giving some time for proxy to being able to accept # connections time.sleep(10) - slap = slapos.slap.slap() - self.slap = slap - self.slap.initializeConnection(config['master_url']) - # register software profile - for path in self.software_path_list: - slap.registerSupply().supply( - path, - computer_guid=config['computer_id']) - computer = slap.registerComputer(config['computer_id']) + try: + slap = slapos.slap.slap() + self.slap = slap + self.slap.initializeConnection(config['master_url']) + # register software profile + for path in self.software_path_list: + slap.registerSupply().supply( + path, + computer_guid=config['computer_id']) + computer = slap.registerComputer(config['computer_id']) + except: + self.log("SlapOSControler.initializeSlapOSControler, \ + exception in registerSupply", exc_info=sys.exc_info()) + raise ValueError("Unable to initializeSlapOSControler") # Reset all previously generated software if needed if reset_software: self._resetSoftware() diff --git a/erp5/util/testnode/testnode.py b/erp5/util/testnode/testnode.py index 84f1ef41aabc4d98fac3467adcd6defc60a5a300..4da0c846f2ba4a4199075743d8c356685757e56d 100644 --- a/erp5/util/testnode/testnode.py +++ b/erp5/util/testnode/testnode.py @@ -436,6 +436,7 @@ branch = %(branch)s try: while True: try: + node_test_suite = None self.log = self.process_manager.log = self.testnode_log self.cleanUp(None) remote_test_result_needs_cleanup = False @@ -497,7 +498,8 @@ branch = %(branch)s except ValueError as e: # This could at least happens if runTestSuite is not found log("ValueError", exc_info=sys.exc_info()) - node_test_suite.retry_software_count += 1 + if node_test_suite is not None: + node_test_suite.retry_software_count += 1 except CancellationError, e: log("CancellationError", exc_info=sys.exc_info()) self.process_manager.under_cancellation = False