Skip to content

Commit

Permalink
Fix search() for list of sentnode addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Apr 15, 2024
1 parent f201fab commit 582ab32
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cli/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def get_nodes(self, latency, *kwargs):
# perfect_match = False, key = "Moniker", value = "Pinco" will match only Moniker like Pincopallo, Pizzapinco10, Pincopallino, Pinco1

def search(self, key: str, value = None, between: tuple = (), from_backup: bool = True, perfect_match: bool = False, is_list: bool = False):
NodeAddressBool = False

if value is None and len(between) == 0:
# at least one of value or between must be setted
return
Expand Down Expand Up @@ -190,6 +192,12 @@ def search(self, key: str, value = None, between: tuple = (), from_backup: bool
if value is not None:
if is_list:
for v in value:
if v == str(identifier):
NodeAddressBool = True
break
else:
NodeAddressBool = False
if not NodeAddressBool:
if perfect_match is True:
if v.lower().strip() != content.data[key].lower():
filtered.remove_node(identifier)
Expand Down

0 comments on commit 582ab32

Please sign in to comment.