diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/statistics_writer/test_statistics_writer_sst.py b/tangostationcontrol/tangostationcontrol/integration_test/default/statistics_writer/test_statistics_writer_sst.py index fea84464ecb0aa0a4de0fef8423200a619da9cbb..f7f9c913c6ca6ba49a486a2afb4066be082ec7ca 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/statistics_writer/test_statistics_writer_sst.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/statistics_writer/test_statistics_writer_sst.py @@ -68,10 +68,10 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase): stat = stat_parser.get_statistic('2021-09-20T12:17:40.000+00:00') # same as stat_parser.statistics[0] self.assertIsNotNone(stat) self.assertEqual(121, stat.data_id_signal_input_index) - # Test RECV attributes - self.assertListEqual(stat.rcu_attenuator_dB.tolist(), [0] * 96) - self.assertListEqual(stat.rcu_band_select.tolist(), [0] * 96) - self.assertListEqual(stat.rcu_dth_on.tolist(), [False] * 96) + # RECV attributes are not present since the stats-writer is not connecting to any host + self.assertEqual(stat.rcu_attenuator_dB.tolist(), None) + self.assertEqual(stat.rcu_band_select.tolist(), None) + self.assertEqual(stat.rcu_dth_on.tolist(), None) def test_no_tango_SST_statistics(self): diff --git a/tangostationcontrol/tangostationcontrol/statistics_writer/statistics_writer.py b/tangostationcontrol/tangostationcontrol/statistics_writer/statistics_writer.py index 806dd6303e12fdc5dedf017bd67b8d04ae573ef2..49add415ca7905446488d56416c5437b994acf9e 100644 --- a/tangostationcontrol/tangostationcontrol/statistics_writer/statistics_writer.py +++ b/tangostationcontrol/tangostationcontrol/statistics_writer/statistics_writer.py @@ -139,11 +139,11 @@ def main(): logger.debug("Setting loglevel to DEBUG") # sets the Tango connection in order to retrieve attribute values - if tango_disabled: + if tango_disabled or not host: logger.warning("Tango connection is DISABLED") device = None else: - device = DeviceProxy(args.device) if mode=='SST' else None + device = DeviceProxy(f"tango://{host}:10000/{args.device}".lower()) if mode=='SST' else None # creates the TCP receiver that is given to the writer receiver = _create_receiver(filename, host, port)