コード例 #1
0
ファイル: kubefuse.py プロジェクト: benmathews/kubefuse
 def __init__(self, mount):
     self.client = KubernetesClient()
     self.fs = KubeFileSystem(self.client)
     self.fd = 0
     print "Mounted on", mount
コード例 #2
0
 def __init__(self, mount):
     self.client = KubernetesClient()
     self.fs = KubeFileSystem(self.client)
     self.fd = 0
     print "Mounted on", mount
コード例 #3
0
ファイル: kubefuse.py プロジェクト: benmathews/kubefuse
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
コード例 #4
0
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