Skip to content
Snippets Groups Projects

Resolve "Initial Publish uptime of CS instance to IS"

#!/usr/bin/env tdaq_python
import logging
import threading
import psutil
from datetime import datetime
@@ -65,9 +64,9 @@ class InfoServiceThread(threading.Thread):
def send_update(self):
try:
self.logger.debug("Getting state from IS")
cs_state = ispy.ISInfoDynAny()
self.is_info_dictionary.getValue("{}.CastorScriptState".format(self.conf.partition), cs_state)
data_identifier = "{}.CastorScriptState".format(self.conf.partition)
cs_state = ispy.ISInfoDynAny() #pylint: disable=no-member
self.is_info_dictionary.getValue(data_identifier, cs_state)
cs_state.tdaq_app_name = self.tdaq_app_name
cs_state.uptime_seconds = self.uptime_seconds
@@ -75,6 +74,6 @@ class InfoServiceThread(threading.Thread):
keep_history = True
self.is_info_dictionary.checkin(data_identifier, self.cs_state, keep_history)
self.logger.debug("Update sent: {}".format(cs_state))
self.logger.debug("Update sent: %s", str(cs_state))
except Exception as ex:
self.logger.warning("Error occured while trying to change cs_state to tdaq_app_name={} uptime_seconds={}. Error was: {}".format(self.tdaq_app_name, self.uptime_seconds, ex))
self.logger.warning("Error occured while trying to change cs_state to tdaq_app_name=%s uptime_seconds=%d. Error was: %s",self.tdaq_app_name, self.uptime_seconds, str(ex))
Loading