pending = [name for time,name in \
list_pending_snapshots(self._propName) if \
name.find(snapshot.fsname + '@') == 0]
- cmd = [zfs.PFCMD, zfs.ZFSCMD, "inherit", self._propName]
+ cmd = [zfs.ZFSCMD, "inherit", self._propName]
util.debug("Unqueuing pending backups of deselected " \
"filesystem: " + snapshot.fsname + '\n' + \
str(pending),
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,
return result
def set_prop(self, propgroup, propname, proptype, value):
- cmd = [PFCMD, SVCCFGCMD, "-s", self.instanceName, "setprop", \
+ cmd = [SVCCFGCMD, "-s", self.instanceName, "setprop", \
propgroup + '/' + propname, "=", proptype + ":", \
value]
util.run_command(cmd)
self.refresh_service()
def set_string_prop(self, propgroup, propname, value):
- cmd = [PFCMD, SVCCFGCMD, "-s", self.instanceName, "setprop", \
+ cmd = [SVCCFGCMD, "-s", self.instanceName, "setprop", \
propgroup + '/' + propname, "=", "astring:",
"\"%s\"" % (value)]
util.run_command(cmd)
self.set_prop(propgroup, propname, "integer", str(value))
def refresh_service(self):
- cmd = [PFCMD, SVCADMCMD, "refresh", self.instanceName]
+ cmd = [SVCADMCMD, "refresh", self.instanceName]
p = subprocess.Popen(cmd, close_fds=True)
def disable_service (self):
if self.svcstate == "disabled":
return
- cmd = [PFCMD, SVCADMCMD, "disable", self.instanceName]
+ cmd = [SVCADMCMD, "disable", self.instanceName]
p = subprocess.Popen(cmd, close_fds=True)
self.svcstate = self.get_service_state()
def enable_service (self):
if (self.svcstate == "online" or self.svcstate == "degraded"):
return
- cmd = [PFCMD, SVCADMCMD, "enable", self.instanceName]
+ cmd = [SVCADMCMD, "enable", self.instanceName]
p = subprocess.Popen(cmd, close_fds=True)
self.svcstate = self.get_service_state()
name = self.snap_name_entry.get_text()
valid_name = self.validate_name (name, True)
if name == valid_name:
- cmd = "pfexec /usr/sbin/zfs snapshot %s@%s" % (self.zfs_fs, self.validate_name (self.snap_name_entry.get_text()))
+ cmd = "/usr/sbin/zfs snapshot %s@%s" % (self.zfs_fs, self.validate_name (self.snap_name_entry.get_text()))
fin,fout,ferr = os.popen3(cmd)
# Check for any error output generated and
# return it to caller if so.
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):
- cmd = [PFCMD, ZFSCMD, "inherit", prop, self.name]
+ cmd = [ZFSCMD, "inherit", prop, self.name]
outdata,errdata = util.run_command(cmd)
class Snapshot(ReadableDataset):
if self.exists() == False:
return
if deferred == False:
- cmd = [PFCMD, ZFSCMD, "destroy", self.name]
+ cmd = [ZFSCMD, "destroy", self.name]
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
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):
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
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))
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):
- cmd = [PFCMD, ZFSCMD, "inherit", prop, self.name]
+ cmd = [ZFSCMD, "inherit", prop, self.name]
outdata,errdata = util.run_command(cmd)
class Snapshot(ReadableDataset):
if self.exists() == False:
return
if deferred == False:
- cmd = [PFCMD, ZFSCMD, "destroy", self.name]
+ cmd = [ZFSCMD, "destroy", self.name]
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
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):
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
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))