def wol(mac, bcast='255.255.255.255', destport=9):
 dest = salt.utils.mac_str_to_bytes(mac)
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
 sock.sendto((('\xff' * 6) + (dest * 16)), (bcast, int(destport)))
 return True

def wol ( mac , bcast = '255.255.255.255' , destport = 9 ) : dest = salt . utils . mac_str_to_bytes ( mac ) sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) sock . setsockopt ( socket . SOL_SOCKET , socket . SO_BROADCAST , 1 ) sock . sendto ( ( ( '\xff' * 6 ) + ( dest * 16 ) ) , ( bcast , int ( destport ) ) ) return True
send a "magic packet" to wake up a minion cli example: .