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

jobs.py « node « fuse « bareos - github.com/bareos/python-bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 41cc141d6acefaba985ce7187df2c1efbbc2784a (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
"""
Bareos specific Fuse node.
"""

from   bareos.fuse.node.directory import Directory
from   bareos.fuse.node.jobslist import JobsList
from   bareos.fuse.node.jobsname import JobsName

class Jobs(Directory):
    def __init__(self, root, name):
        super(Jobs, self).__init__(root, name)
        self.static = True

    @classmethod
    def get_id(cls, name):
        return "unique"

    def do_update(self):
        data = self.bsock.call(".jobs")
        jobs = data['jobs']
        for i in jobs:
            self.add_subnode(JobsName, i['name'])
        self.add_subnode(JobsList, "all")
        self.add_subnode(JobsList, "running", "jobstatus=running")