diff --git a/csp-lmc-common/csp_lmc_common/CspSubarray.py b/csp-lmc-common/csp_lmc_common/CspSubarray.py index dabd9e7589d9b6cc6bc11d4b503c006aff313613..34b9ce85120a58299fffff9d121cf091d37bbbcc 100644 --- a/csp-lmc-common/csp_lmc_common/CspSubarray.py +++ b/csp-lmc-common/csp_lmc_common/CspSubarray.py @@ -597,14 +597,16 @@ class CspSubarray(SKASubarray): for fqdn in subelement_thr.keys(): subelement_thr[fqdn].join() - if all(self.empty_succeeded[fqdn] for fqdn in device_to_turn_off): + if all(self.empty_succeeded[fqdn] for fqdn in device_to_turn_off) and device_to_turn_off: + + result_code = ResultCode.FAILED + for fqdn in device_to_turn_off: try: self.logger.info('Sending Off Command...') (result_code, message) = device._sc_subarray_proxies[fqdn].Off() except tango.DevFailed as tango_err: message = str(tango_err.args[0].desc) - result_code = ResultCode.FAILED if result_code == ResultCode.FAILED: self.logger.error("Off command failed on device {}".format(fqdn))