git://git.camperquake.de
/
time-slider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial attempt at python3 conversion
[time-slider.git]
/
usr
/
share
/
time-slider
/
lib
/
plugin
/
zfssend
/
zfssend.py
diff --git
a/usr/share/time-slider/lib/plugin/zfssend/zfssend.py
b/usr/share/time-slider/lib/plugin/zfssend/zfssend.py
index
403cf5c
..
12e1ff5
100644
(file)
--- a/
usr/share/time-slider/lib/plugin/zfssend/zfssend.py
+++ b/
usr/share/time-slider/lib/plugin/zfssend/zfssend.py
@@
-33,7
+33,7
@@
import time_slider.zfs
# Set to True if SMF property value of "plugin/command" is "true"
verboseprop = "plugin/verbose"
propbasename = "org.opensolaris:time-slider-plugin"
# Set to True if SMF property value of "plugin/command" is "true"
verboseprop = "plugin/verbose"
propbasename = "org.opensolaris:time-slider-plugin"
-print
_("Do I work?"
)
+print
(_("Do I work?")
)
def main(argv):
def main(argv):
@@
-129,7
+129,7
@@
def main(argv):
# Check to see if the receive command is accessible and executable
try:
statinfo = os.stat(recvcmd[0])
# Check to see if the receive command is accessible and executable
try:
statinfo = os.stat(recvcmd[0])
- other_x = (statinfo.st_mode & 01)
+ other_x = (statinfo.st_mode & 0
o
1)
if other_x == 0:
log_error(syslog.LOG_ERR,
"Plugin: %s: Configured receive/command is not " \
if other_x == 0:
log_error(syslog.LOG_ERR,
"Plugin: %s: Configured receive/command is not " \
@@
-177,12
+177,6
@@
def main(argv):
sys.exit(-1)
sys.exit(-1)
- # Invoke the send and receive commands via pfexec(1) since
- # we are not using the role's shell to take care of that
- # for us.
- sendcmd.insert(0, smf.PFCMD)
- recvcmd.insert(0, smf.PFCMD)
-
try:
sendP = subprocess.Popen(sendcmd,
stdout=subprocess.PIPE,
try:
sendP = subprocess.Popen(sendcmd,
stdout=subprocess.PIPE,
@@
-199,13
+193,13
@@
def main(argv):
senderrno = sendP.wait()
if senderrno != 0:
senderrno = sendP.wait()
if senderrno != 0:
- raise RuntimeError
,
"Send command: %s failed with exit code" \
+ raise RuntimeError
(
"Send command: %s failed with exit code" \
"%d. Error message: \n%s" \
"%d. Error message: \n%s" \
- % (str(sendcmd), senderrno, senderr)
+ % (str(sendcmd), senderrno, senderr)
)
if recverrno != 0:
if recverrno != 0:
- raise RuntimeError
,
"Receive command %s failed with exit " \
+ raise RuntimeError
(
"Receive command %s failed with exit " \
"code %d. Error message: \n%s" \
"code %d. Error message: \n%s" \
- % (str(recvcmd), recverrno, recverr)
+ % (str(recvcmd), recverrno, recverr)
)
if prevsnapname != None:
util.debug("Releasing hold on %s" % (prevsnapname), verbose)
if prevsnapname != None:
util.debug("Releasing hold on %s" % (prevsnapname), verbose)
@@
-214,7
+208,7
@@
def main(argv):
% (prevsnapname),
verbose)
snapshot.release(propname)
% (prevsnapname),
verbose)
snapshot.release(propname)
- except Exception
,
message:
+ except Exception
as
message:
log_error(syslog.LOG_ERR,
"Error during snapshot send/receive operation: %s" \
% (message))
log_error(syslog.LOG_ERR,
"Error during snapshot send/receive operation: %s" \
% (message))