import logging

from gateway_core.domain.SoftwareUpgrade import SoftwareUpgradeDto
from gateway_node_agent.application.ports.upgradeExecutorPort import UpgradeExecutorPort

logger = logging.getLogger(__name__)


class LocalUpgradeUseCase:
    def __init__(self, *, executor: UpgradeExecutorPort) -> None:
        self._executor = executor

    async def execute(self, dto: SoftwareUpgradeDto) -> None:
        logger.info("LocalUpgradeUseCase: %s", dto)
        await self._executor.execute(dto)
