def __init__(self, mount): self.client = KubernetesClient() self.fs = KubeFileSystem(self.client) self.fd = 0 print "Mounted on", mount
class KubeFuse(LoggingMixIn, Operations): def __init__(self, mount): self.client = KubernetesClient() self.fs = KubeFileSystem(self.client) self.fd = 0 print "Mounted on", mount def readdir(self, path, fh): return self.fs.list_files(path) def getattr(self, path, fh=None): return self.fs.getattr(path) def open(self, path, fh): self.fd += 1 self.fs.open(path, fh) return self.fd def read(self, path, size, offset, fh): return self.fs.read(path, size, offset) def truncate(self, path, length, fh=None): self.fs.truncate(path, length) return 0 def write(self, path, buf, offset, fh): written = self.fs.write(path, buf, offset) return written def flush(self, path, fh): self.fs.sync(path) return 0 def release(self, path, fh): self.fs.close(path) return 0