git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autopep8
[plcapi.git]
/
PLC
/
POD.py
diff --git
a/PLC/POD.py
b/PLC/POD.py
index
5b92dd3
..
a5eddfd
100644
(file)
--- a/
PLC/POD.py
+++ b/
PLC/POD.py
@@
-1,4
+1,3
@@
-# $Id#
# Marc E. Fiuczynski <mef@cs.princeton.edu>
# Copyright (C) 2004 The Trustees of Princeton University
#
# Marc E. Fiuczynski <mef@cs.princeton.edu>
# Copyright (C) 2004 The Trustees of Princeton University
#
@@
-67,14
+66,14
@@
def _construct(id, data):
def icmp_pod(host,key):
uid = os.getuid()
def icmp_pod(host,key):
uid = os.getuid()
- if uid
<>
0:
- print
"must be root to send icmp pod"
+ if uid
!=
0:
+ print
("must be root to send icmp pod")
return
return
-
+
s = socket(AF_INET, SOCK_RAW, getprotobyname("icmp"))
packet = _construct(0, key) # make a ping packet
addr = (host,1)
s = socket(AF_INET, SOCK_RAW, getprotobyname("icmp"))
packet = _construct(0, key) # make a ping packet
addr = (host,1)
- print
'pod sending icmp-based reboot request to %s' % host
+ print
('pod sending icmp-based reboot request to %s' % host)
for i in range(1,10):
s.sendto(packet, addr)
for i in range(1,10):
s.sendto(packet, addr)
@@
-83,7
+82,7
@@
def udp_pod(host,key,fromaddr=('', 0)):
s = socket(AF_INET, SOCK_DGRAM)
s.bind(fromaddr)
packet = key
s = socket(AF_INET, SOCK_DGRAM)
s.bind(fromaddr)
packet = key
- print
'pod sending udp-based reboot request to %s' % host
+ print
('pod sending udp-based reboot request to %s' % host)
for i in range(1,10):
s.sendto(packet, addr)
for i in range(1,10):
s.sendto(packet, addr)