diff --git a/src/uds/services/PhysicalMachines/deployment_multi.py b/src/uds/services/PhysicalMachines/deployment_multi.py index 9397b9c18..6fb5298a8 100644 --- a/src/uds/services/PhysicalMachines/deployment_multi.py +++ b/src/uds/services/PhysicalMachines/deployment_multi.py @@ -94,6 +94,9 @@ def get_unique_id(self) -> str: @typing.override def set_ready(self) -> types.states.TaskState: + # User-services migrated from v3.6 may carry an empty _mac, so refresh from + # the Server model before waking up or WOL would be sent to nothing. + self.update_ip() self.service().wakeup(self._ip, self._mac) return types.states.TaskState.FINISHED diff --git a/src/uds/services/PhysicalMachines/provider.py b/src/uds/services/PhysicalMachines/provider.py index b682d3103..9e33d36c4 100644 --- a/src/uds/services/PhysicalMachines/provider.py +++ b/src/uds/services/PhysicalMachines/provider.py @@ -36,7 +36,7 @@ from django.utils.translation import gettext_noop as _ -from uds.core import exceptions, services, types +from uds.core import consts, exceptions, services, types from uds.core.ui.user_interface import gui from uds.core.util import net, resolver @@ -119,7 +119,7 @@ def wake_on_lan_endpoint(self, host: str, mac: str) -> str: Returns: str: URL of WOL server or empty ('') if no server for the ip is found """ - if not self.config.value or not host or not mac: + if not self.config.value or not host or not mac or mac == consts.NULL_MAC: return '' # If host is a hostname, try to resolve it