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
Add linux specific autosnapsmf module and dependencies
[time-slider.git]
/
usr
/
share
/
time-slider
/
lib
/
time_slider
/
zfs.py
diff --git
a/usr/share/time-slider/lib/time_slider/zfs.py
b/usr/share/time-slider/lib/time_slider/zfs.py
old mode 100755
(executable)
new mode 100644
(file)
index
b35e58d
..
4db0574
--- a/
usr/share/time-slider/lib/time_slider/zfs.py
+++ b/
usr/share/time-slider/lib/time_slider/zfs.py
@@
-1,4
+1,4
@@
-#!/usr/bin/python2
.6
+#!/usr/bin/python2
#
# CDDL HEADER START
#
#
# CDDL HEADER START
#
@@
-132,6
+132,9
@@
class Datasets(Exception):
if excludedchild == False:
# We want recursive list sorted in alphabetical order
# so insert instead of append to the list.
if excludedchild == False:
# We want recursive list sorted in alphabetical order
# so insert instead of append to the list.
+ # Also, remove all children from the recursive
+ # list, as they are covered by the parent
+ recursive = [x for x in recursive if x not in children]
recursive.insert(0, datasetname)
for datasetname in recursive:
recursive.insert(0, datasetname)
for datasetname in recursive:
@@
-656,11
+659,11
@@
class ReadableDataset:
return outdata.rstrip()
def set_user_property(self, prop, value):
return outdata.rstrip()
def set_user_property(self, prop, value):
- cmd = [
PFCMD,
ZFSCMD, "set", "%s=%s" % (prop, value), self.name]
+ cmd = [ZFSCMD, "set", "%s=%s" % (prop, value), self.name]
outdata,errdata = util.run_command(cmd)
def unset_user_property(self, prop):
outdata,errdata = util.run_command(cmd)
def unset_user_property(self, prop):
- cmd = [
PFCMD,
ZFSCMD, "inherit", prop, self.name]
+ cmd = [ZFSCMD, "inherit", prop, self.name]
outdata,errdata = util.run_command(cmd)
class Snapshot(ReadableDataset):
outdata,errdata = util.run_command(cmd)
class Snapshot(ReadableDataset):
@@
-737,9
+740,9
@@
class Snapshot(ReadableDataset):
if self.exists() == False:
return
if deferred == False:
if self.exists() == False:
return
if deferred == False:
- cmd = [
PFCMD,
ZFSCMD, "destroy", self.name]
+ cmd = [ZFSCMD, "destroy", self.name]
else:
else:
- cmd = [
PFCMD,
ZFSCMD, "destroy", "-d", self.name]
+ cmd = [ZFSCMD, "destroy", "-d", self.name]
outdata,errdata = util.run_command(cmd)
# Clear the global snapshot cache so that a rescan will be
outdata,errdata = util.run_command(cmd)
# Clear the global snapshot cache so that a rescan will be
@@
-755,7
+758,7
@@
class Snapshot(ReadableDataset):
if self.exists() == False:
return
if self.exists() == False:
return
- cmd = [
PFCMD,
ZFSCMD, "hold", tag, self.name]
+ cmd = [ZFSCMD, "hold", tag, self.name]
outdata,errdata = util.run_command(cmd)
def holds(self):
outdata,errdata = util.run_command(cmd)
def holds(self):
@@
-785,7
+788,7
@@
class Snapshot(ReadableDataset):
if self.exists() == False:
return
if self.exists() == False:
return
- cmd = [
PFCMD,
ZFSCMD, "release", tag, self.name]
+ cmd = [ZFSCMD, "release", tag, self.name]
outdata,errdata = util.run_command(cmd)
# Releasing the snapshot might cause it get automatically
outdata,errdata = util.run_command(cmd)
# Releasing the snapshot might cause it get automatically
@@
-852,7
+855,7
@@
class ReadWritableDataset(ReadableDataset):
Recursively snapshot childfren of this dataset.
Default = False
"""
Recursively snapshot childfren of this dataset.
Default = False
"""
- cmd = [
PFCMD,
ZFSCMD, "snapshot"]
+ cmd = [ZFSCMD, "snapshot"]
if recursive == True:
cmd.append("-r")
cmd.append("%s@%s" % (self.name, snaplabel))
if recursive == True:
cmd.append("-r")
cmd.append("%s@%s" % (self.name, snaplabel))