diff --git a/devices/toolkit/archiver.py b/devices/toolkit/archiver.py index 1ec7f642b4d57a0a9d1026cbd7f5ae576b2731cf..fe3b1f87dcf43450331056da59403c823f10d742 100644 --- a/devices/toolkit/archiver.py +++ b/devices/toolkit/archiver.py @@ -18,6 +18,15 @@ class Archiver(): def __init__(self, cm_name: str = 'archiving/hdbpp/confmanager01', es_name: str = 'archiving/hdbpp/eventsubscriber01', context: str = 'RUN'): self.cm_name = cm_name self.cm = DeviceProxy(cm_name) + try: + cm_state = self.cm.state() # ping the device server + if cm_state is 'FAULT': + print('Configuration Manager is in FAULT state') + print(self.cm.status()) + return + except: + print(traceback.format_exc()) + return self.es_name = es_name self.es = DeviceProxy(es_name) self.cm.write_attribute('Context',context) # Set default Context Archiving for all the subscribers @@ -195,7 +204,7 @@ class Archiver(): return errs_dict.get(e) return None - def get_subscriber_load(self,use_freq=True,es_name:str = None): + def get_subscriber_load(self,use_freq:bool=True,es_name:str = None): """ Return the estimated load of an archiver, in frequency of records or number of attributes