Skip to content
Snippets Groups Projects
Commit 5a6e97e1 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-235: add exception catching if containers are offline

parent db1b775a
No related branches found
No related tags found
1 merge request!108Resolve L2SS-235 "Archive pcc attribute"
...@@ -18,6 +18,15 @@ class Archiver(): ...@@ -18,6 +18,15 @@ class Archiver():
def __init__(self, cm_name: str = 'archiving/hdbpp/confmanager01', es_name: str = 'archiving/hdbpp/eventsubscriber01', context: str = 'RUN'): 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_name = cm_name
self.cm = DeviceProxy(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_name = es_name
self.es = DeviceProxy(es_name) self.es = DeviceProxy(es_name)
self.cm.write_attribute('Context',context) # Set default Context Archiving for all the subscribers self.cm.write_attribute('Context',context) # Set default Context Archiving for all the subscribers
...@@ -195,7 +204,7 @@ class Archiver(): ...@@ -195,7 +204,7 @@ class Archiver():
return errs_dict.get(e) return errs_dict.get(e)
return None 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 Return the estimated load of an archiver, in frequency of records or number
of attributes of attributes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment