Ошибка синтаксиса.

This commit is contained in:
2025-11-19 12:46:04 +10:00
parent 38633c9146
commit 99b997fac3

View File

@@ -187,7 +187,7 @@ if __name__ == "__main__":
# собираем комьюнити маршрутов
bgp_community=str()
for c in str(ip_list[clist]['community']).split(","):
bgp_community+=f"bgp_community.add(({str(c).replace(":",",")})); "
bgp_community+=f"bgp_community.add(({str(c).replace(':',',')})); "
# сохраняем в файл
with open(ipv4_out_file, "a") as file:
file.write(f"protocol static static_{clist.lower()} {{\n ipv4 {{ import filter {{ {bgp_community}accept; }}; }};\n{ipv4_list}}}\n")
@@ -203,7 +203,7 @@ if __name__ == "__main__":
# собираем комьюнити маршрутов
bgp_community=str()
for c in str(ip_list[clist]['community']).split(","):
bgp_community+=f"bgp_community.add(({str(c).replace(":",",")})); "
bgp_community+=f"bgp_community.add(({str(c).replace(':',',')})); "
# сохраняем в файл
with open(ipv6_out_file, "a") as file:
file.write(f"protocol static static_{clist.lower()} {{\n ipv6 {{ import filter {{ {bgp_community}accept; }}; }};\n{ipv6_list}}}\n")