From e588bf0c207db18e6e34c93caebb286e2e27ac0b Mon Sep 17 00:00:00 2001 From: host Date: Sat, 25 Jul 2026 10:51:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=8B=D0=BD=D0=B5=D1=81=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B2=20top-level=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/templates.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/app/routers/templates.py b/backend/app/routers/templates.py index d8f30e9..33d0c06 100644 --- a/backend/app/routers/templates.py +++ b/backend/app/routers/templates.py @@ -1,3 +1,4 @@ +import logging from typing import List from fastapi import APIRouter, Depends @@ -7,6 +8,8 @@ from .. import models, schemas, proxmox_client as pve from ..database import get_db from ..deps import get_current_user, require_admin +logger = logging.getLogger(__name__) + router = APIRouter(prefix="/templates", tags=["templates"]) @@ -34,14 +37,12 @@ def list_proxmox_templates(_=Depends(require_admin)): try: vm_tpls = pve.list_vm_templates() except Exception as exc: - import logging - logging.getLogger(__name__).warning("Ошибка получения VM-шаблонов из Proxmox: %s", exc) + logger.warning("Ошибка получения VM-шаблонов из Proxmox: %s", exc) vm_tpls = [] try: lxc_tpls = pve.list_lxc_templates() except Exception as exc: - import logging - logging.getLogger(__name__).warning("Ошибка получения LXC-шаблонов из Proxmox: %s", exc) + logger.warning("Ошибка получения LXC-шаблонов из Proxmox: %s", exc) lxc_tpls = [] return {"vm_templates": vm_tpls, "lxc_templates": lxc_tpls}