update_manager: use the machine component to restart services
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
be338ad039
commit
3b27ab49f1
|
@ -23,6 +23,7 @@ from typing import (
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from confighelper import ConfigHelper
|
from confighelper import ConfigHelper
|
||||||
from .update_manager import CommandHelper
|
from .update_manager import CommandHelper
|
||||||
|
from ..machine import Machine
|
||||||
|
|
||||||
CHANNEL_TO_TYPE = {
|
CHANNEL_TO_TYPE = {
|
||||||
"stable": "zip",
|
"stable": "zip",
|
||||||
|
@ -173,9 +174,9 @@ class AppDeploy(BaseDeploy):
|
||||||
|
|
||||||
async def _do_restart(self) -> None:
|
async def _do_restart(self) -> None:
|
||||||
self.notify_status("Restarting Service...")
|
self.notify_status("Restarting Service...")
|
||||||
|
machine: Machine = self.server.lookup_component("machine")
|
||||||
try:
|
try:
|
||||||
await self.cmd_helper.run_cmd(
|
await machine.do_service_action("restart", self.name)
|
||||||
f"sudo systemctl restart {self.name}")
|
|
||||||
except Exception:
|
except Exception:
|
||||||
if self.name == "moonraker":
|
if self.name == "moonraker":
|
||||||
# We will always get an error when restarting moonraker
|
# We will always get an error when restarting moonraker
|
||||||
|
|
Loading…
Reference in New Issue