fix WOL in docker/jail (#6810)

* fix WOL in docker/jail

add ip_address parameter to send_magic_packet if host specific.

in docker/jail, WOL doesn't works due to subnet broadcast issues.

* Update wake_on_lan.py

lint
This commit is contained in:
goto100 2017-03-27 20:02:43 +08:00 committed by Fabian Affolter
parent c53de19246
commit b8c1bc9542

View file

@ -75,7 +75,11 @@ class WOLSwitch(SwitchDevice):
def turn_on(self):
"""Turn the device on."""
self._wol.send_magic_packet(self._mac_address)
if self._host:
self._wol.send_magic_packet(self._mac_address,
ip_address=self._host)
else:
self._wol.send_magic_packet(self._mac_address)
def turn_off(self):
"""Turn the device off if an off action is present."""