Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccc5b9a
commit 0b34c5b
Showing
5 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Bareos specific Fuse node. | ||
""" | ||
|
||
from bareos.fuse.node.directory import Directory | ||
from bareos.fuse.node.file import File | ||
from bareos.fuse.node.volumelist import VolumeList | ||
from pprint import pformat | ||
|
||
class Pool(Directory): | ||
def __init__(self, root, name, pool): | ||
super(Pool, self).__init__(root, name) | ||
self.pool = pool | ||
|
||
@classmethod | ||
def get_id(cls, name, pool): | ||
return name | ||
|
||
def do_update_stat(self): | ||
data = self.bsock.call("llist pools count" % (self.selector)) | ||
self.subnode_count = int(data['pools'][0]['count']) | ||
|
||
def do_update(self): | ||
data = self.bsock.call("llist pools") | ||
pools = data['pools'] | ||
for i in pools: | ||
self.add_subnode(Pool, i['name']) | ||
|
||
def do_update_stat(self): | ||
self.subnode_count = 2 | ||
|
||
def do_update(self): | ||
self.add_subnode(File, name="info.txt", content=pformat(self.pool) + "\n") | ||
self.add_subnode(VolumeList, name="volumes", selector="pool=%s" % (self.name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Bareos specific Fuse node. | ||
""" | ||
|
||
from bareos.fuse.node.directory import Directory | ||
from bareos.fuse.node.pool import Pool | ||
|
||
class Pools(Directory): | ||
def __init__(self, root, name): | ||
super(Pools, self).__init__(root, name) | ||
self.static = True | ||
|
||
@classmethod | ||
def get_id(cls, name): | ||
return "unique" | ||
|
||
def do_update(self): | ||
data = self.bsock.call("llist pools") | ||
pools = data['pools'] | ||
for i in pools: | ||
self.add_subnode(Pool, i['name'], i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters