From cea100c834388e49850898146fcaf53d62531d92 Mon Sep 17 00:00:00 2001 From: Gianluca Marotta Date: Wed, 24 Feb 2021 12:29:15 +0000 Subject: [PATCH] FIx bug on Off command --- csp-lmc-common/csp_lmc_common/CspSubarray.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/csp-lmc-common/csp_lmc_common/CspSubarray.py b/csp-lmc-common/csp_lmc_common/CspSubarray.py index dabd9e7..34b9ce8 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)) -- GitLab