Skip to content

Commit

Permalink
Merge pull request #14 from cherusk/bug_repair_init
Browse files Browse the repository at this point in the history
bufix - repair config parsing in selector
  • Loading branch information
cherusk authored Jan 7, 2023
2 parents f72e4e4 + 4d0e721 commit d08dcd3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions prometheus_ss_exporter/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 12 additions & 8 deletions test/selection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]
}
}
}
}
Expand All @@ -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 }]
}
}
}
}
Expand Down

0 comments on commit d08dcd3

Please sign in to comment.