Skip to content
Snippets Groups Projects
Commit 813fc198 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-544: Remove guards against what is logically always False

parent b749cdc8
Branches
Tags
1 merge request!199L2SS-544: Improve LibConfiguration parsing, and return a dict instead of list...
......@@ -72,7 +72,7 @@ class Archiver():
raise Exception(f"Configuration Manager {cm_name} is in FAULT state")
except Exception as e:
raise Exception(f"Connection failed with Configuration Manager {cm_name}") from e
self.es_list = [es_name for es_name in self.get_subscribers(from_db=False)] or []
self.es_list = [es_name for es_name in self.get_subscribers(from_db=False)]
self.cm.write_attribute('Context',context) # Set default Context Archiving for all the subscribers
self.selector = Selector() if selector_filename is None else Selector(selector_filename) # Create selector for customized strategies
try:
......@@ -383,7 +383,7 @@ class Archiver():
errs_dict = self.get_subscriber_errors()
for e in errs_dict:
if attribute_name in e:
return errs_dict.get(e)
return errs_dict[e]
return None
def get_subscriber_load(self,use_freq:bool=True,es_name:str = None):
......@@ -422,7 +422,7 @@ class Archiver():
freq_dict = {a: r for a,r in zip(es.AttributeList,es.AttributeRecordFreqList)}
for f in freq_dict:
if attribute_name.lower() in f:
return freq_dict.get(f,0.)
return freq_dict[f]
else:
logger.warning(f"Attribute {attribute_name} not found!")
......@@ -436,7 +436,7 @@ class Archiver():
fail_dict = {a: r for a,r in zip(es.AttributeList,es.AttributeFailureFreqList)}
for f in fail_dict:
if attribute_name.lower() in f:
return fail_dict.get(f,0.)
return fail_dict[f]
else:
logger.warning(f"Attribute {attribute_name} not found!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment