Welcome to mirror list, hosted at ThFree Co, Russian Federation.

root.py « fuse « bareos - github.com/bareos/python-bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8e127412df5a6070f2018a5dc119ae564dfc41c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
bareosfs root node (top level directory)
"""

import bareos.fuse.exceptions
from   bareos.fuse.nodefactory import NodeFactory
from   bareos.fuse.node.directory import Directory
from   bareos.fuse.node import *

class Root(Directory):
    """
    Define filesystem structure of root (/) directory.
    """
    def __init__(self, bsock, restoreclient, restorepath):
        self.bsock = bsock
        self.restoreclient = restoreclient
        if restoreclient:
            data = self.bsock.call(".clients")
            if not restoreclient in [item['name'] for item in data['clients']]:
                raise bareos.fuse.RestoreClientUnknown(restoreclient)
        self.restorepath = restorepath
        super(Root, self).__init__(self, None)
        self.factory = NodeFactory(self)
        self.add_subnode(Jobs, "jobs")
        self.add_subnode(Volumes, "volumes")
        self.add_subnode(Clients, "clients")