Skip to content
Snippets Groups Projects
Commit 95deb35e authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-868: Prevent undefined variable from disabling tango in sst_writer

parent 79dcec4e
Branches
Tags
1 merge request!394Resolve L2SS-868
...@@ -71,10 +71,10 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase): ...@@ -71,10 +71,10 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
stat = stat_parser.get_statistic('2021-09-20T12:17:40.000+00:00') # same as stat_parser.statistics[0] stat = stat_parser.get_statistic('2021-09-20T12:17:40.000+00:00') # same as stat_parser.statistics[0]
self.assertIsNotNone(stat) self.assertIsNotNone(stat)
self.assertEqual(121, stat.data_id_signal_input_index) self.assertEqual(121, stat.data_id_signal_input_index)
# RECV attributes are not present since the stats-writer is not connecting to any host # Test RECV attributes
self.assertEqual(stat.rcu_attenuator_dB.tolist(), None) self.assertListEqual(stat.rcu_attenuator_dB.tolist(), [0] * 96)
self.assertEqual(stat.rcu_band_select.tolist(), None) self.assertListEqual(stat.rcu_band_select.tolist(), [0] * 96)
self.assertEqual(stat.rcu_dth_on.tolist(), None) self.assertListEqual(stat.rcu_dth_on.tolist(), [False] * 96)
def test_no_tango_SST_statistics(self): def test_no_tango_SST_statistics(self):
......
...@@ -153,11 +153,13 @@ def main(): ...@@ -153,11 +153,13 @@ def main():
logger.debug("Setting loglevel to DEBUG") logger.debug("Setting loglevel to DEBUG")
# sets the Tango connection in order to retrieve attribute values # sets the Tango connection in order to retrieve attribute values
if tango_disabled or not host: if tango_disabled:
logger.warning("Tango connection is DISABLED") logger.warning("Tango connection is DISABLED")
device = None device = None
else: elif host:
device = DeviceProxy(f"tango://{host}:10000/{args.device}".lower()) if mode == 'SST' else None device = DeviceProxy(f"tango://{host}:10000/{args.device}".lower()) if mode == 'SST' else None
else:
device = DeviceProxy(args.device) if mode == 'SST' else None
# creates the TCP receiver that is given to the writer # creates the TCP receiver that is given to the writer
receiver = _create_receiver(filename, host, port) receiver = _create_receiver(filename, host, port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment