Skip to content

Commit 9af2ec9

Browse files
committed
bugfix messages multineighbor
1 parent 880723b commit 9af2ec9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

flowapp/messages.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,11 @@ def create_rtbh(rule, message_type=ANNOUNCE):
100100
try:
101101
if current_app.config["USE_MULTI_NEIGHBOR"] and rule.community.comm:
102102
if rule.community.comm in current_app.config["MULTI_NEIGHBOR"].keys():
103-
target = current_app.config["MULTI_NEIGHBOR"].get(rule.community.comm)
104-
neighbor = "neighbor {target} ".format(target=target)
103+
targets = current_app.config["MULTI_NEIGHBOR"].get(rule.community.comm)
105104
else:
106105
targets = current_app.config["MULTI_NEIGHBOR"].get("primary")
107-
neighbor = prepare_multi_neighbor(targets)
108-
106+
107+
neighbor = prepare_multi_neighbor(targets)
109108
else:
110109
neighbor = ""
111110
except KeyError:
@@ -253,9 +252,9 @@ def sanitize_mask(rule_mask, default_mask=IPV4_DEFMASK):
253252
return default_mask
254253

255254

256-
def prepare_multi_neighbor(targets):
255+
def prepare_multi_neighbor(targets: list):
257256
"""
258257
prepare multi neighbor string
259258
"""
260-
neigbors = ["neighbor {}".format(tgt) for tgt in targets]
259+
neigbors = [f"neighbor {tgt}" for tgt in targets]
261260
return ", ".join(neigbors) + " "

0 commit comments

Comments
 (0)