def setupLocalZfs(cls): config = getattr(cls, zfsConfig.ZfsConfig.configAttrName) localRoot = tempfile.mkdtemp(prefix='zfsMountPoint') localTar = config.get("localZfs", "zfsMetaTar") localZfsConfig = config.get("localZfs", "zfsConfigFile") cls.localZfs = ZfsProxy(metaTar=localTar, zfsRoot=localRoot, config=localZfsConfig) cls.localZfsDir = os.path.join(localRoot, config.get("localZfs", "zfsVolumeDir"))
class RemoteZfs(pb.Referenceable): def __init__(self, *arg, **kwargs): self.zfs = ZfsProxy(*arg, **kwargs) @wrapException def remote_start(self): return self.zfs.runZfs() @wrapException def remote_stop(self): return self.zfs.stopZfs() @wrapException def remote_cleanup(self): return self.zfs.cleanup() @wrapException def remote_running(self): return self.zfs.running() @wrapException def remote_hasDied(self): return self.zfs.hasDied() @wrapException def remote_signalAll(self, signal): return self.zfs.signalAll(signal) @wrapException def remote_snapshot(self): toDir = tempfile.mkdtemp(prefix="noseSnapshot") snapshot = SnapshotDescription(toDir) self.zfs.snapshot(snapshot) (handle, fileName) = tempfile.mkstemp() snapshot.pack(fileName) snapshot.delete() return RemoteFile(fileName, 'r') @wrapException def remote_getMountPoint(self): return self.zfs.zfsRoot
class RemoteZfs(pb.Referenceable): def __init__(self, *arg, **kwargs): self.zfs = ZfsProxy(*arg, **kwargs) @wrapException def remote_start(self): return self.zfs.runZfs() @wrapException def remote_stop(self): return self.zfs.stopZfs() @wrapException def remote_cleanup(self): return self.zfs.cleanup() @wrapException def remote_running(self): return self.zfs.running() @wrapException def remote_hasDied(self): return self.zfs.hasDied() @wrapException def remote_signalAll(self, signal): return self.zfs.signalAll(signal) @wrapException def remote_snapshot(self): toDir = tempfile.mkdtemp(prefix="noseSnapshot") snapshot = SnapshotDescription(toDir) self.zfs.snapshot(snapshot) (handle,fileName) = tempfile.mkstemp() snapshot.pack(fileName) snapshot.delete() return RemoteFile(fileName, 'r') @wrapException def remote_getMountPoint(self): return self.zfs.zfsRoot
def __init__(self, *arg, **kwargs): self.zfs = ZfsProxy(*arg, **kwargs)