diff --git a/prometheus_ss_exporter/selection.py b/prometheus_ss_exporter/selection.py index 4c5e16d..b3d4f04 100644 --- a/prometheus_ss_exporter/selection.py +++ b/prometheus_ss_exporter/selection.py @@ -61,6 +61,7 @@ def process(self, flow, def __init__(self, cnfg): key = 'selection' + cnfg = cnfg.get('logic') if (key in cnfg.keys() and cnfg[key]): self._core = self._arbitrate diff --git a/test/selection_test.py b/test/selection_test.py index a5aeded..b6d99fc 100644 --- a/test/selection_test.py +++ b/test/selection_test.py @@ -98,10 +98,12 @@ def test_process_accept_test(self): def test_combined_accept_test(self): selection_config = { - 'selection': { - 'peering': { - 'networks': [ '192.168.0.0/16' ], - 'portranges': [{ 'lower': 1000, 'upper': 2000 }] + 'logic': { + 'selection': { + 'peering': { + 'networks': [ '192.168.0.0/16' ], + 'portranges': [{ 'lower': 1000, 'upper': 2000 }] + } } } } @@ -114,10 +116,12 @@ def test_combined_accept_test(self): def test_combined_decline_test(self): selection_config = { - 'selection': { - 'peering': { - 'networks': [ '192.168.0.0/16' ], - 'portranges': [{ 'lower': 1000, 'upper': 2000 }] + 'logic': { + 'selection': { + 'peering': { + 'networks': [ '192.168.0.0/16' ], + 'portranges': [{ 'lower': 1000, 'upper': 2000 }] + } } } }