From 354dbf6e37bbb029fb3757a7def7ff04f4e3e40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=88=D0=B5=20=D0=98=D0=BC=D1=8F?= Date: Wed, 10 May 2023 11:31:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20enablemap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hlna.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hlna.py b/hlna.py index c1d3c38..2b8893a 100755 --- a/hlna.py +++ b/hlna.py @@ -294,7 +294,9 @@ def enablemap(m,e): if i in list_config: print(f"Карта {i} уже есть в активных") continue - data = read_yaml(i) + + data = read_yaml(i, False) + if data['Port'] in port_s: print("Предлагаем заменить") if data['QueryPort'] in query_p: @@ -422,7 +424,7 @@ def start(m, b, name_server=list_config): print("Ни одной карты не установлено") -def read_yaml(name_server, flag=True): +def read_yaml(name_server=list_config, flag=True): # Читаем конфиги активных или неактивных карт в зависимости от флага dirs = f"{dir_config}{name_server}" if flag else f"{dir_config}deactivated/{name_server}"