|
|
|
@ -100,6 +100,7 @@ async def send_async_request(cfg: Config, json_body: dict) -> None:
|
|
|
|
|
url = cfg.central_host_url |
|
|
|
|
portion = cfg.request_portion |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
async with aiohttp.ClientSession(connector=conn) as session: |
|
|
|
|
# получаем количесвто записей |
|
|
|
|
count = await get_records_count(session, url) |
|
|
|
@ -114,6 +115,8 @@ async def send_async_request(cfg: Config, json_body: dict) -> None:
|
|
|
|
|
resp = await response.json() |
|
|
|
|
hosts = [i["hostname"] for i in resp.get("result")] |
|
|
|
|
await write_config_files(hosts, cfg, template) |
|
|
|
|
except ClientConnectorError: |
|
|
|
|
print(f"Невозможно подключиться к серверу {url}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def read_config(path_to_conf_file: str, section: str = "Main") -> Config: |
|
|
|
|