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

github.com/bareos/python-bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Steffens <joerg.steffens@bareos.com>2015-09-28 15:26:28 +0300
committerJoerg Steffens <joerg.steffens@bareos.com>2015-09-28 15:26:28 +0300
commit2c39c60294221c8092367aa2fb3bc5b11a967d92 (patch)
tree111a4266aaf8f9b4d8769438419cfc6acdc9f5ab
parente95a4d3ca25e885301cb57ca097884e0b8b3ef31 (diff)
joblog.txt -> job.log
- removed unessary newlines - skip lines with can't be encoded as strings
-rw-r--r--bareos/fuse/node/job.py2
-rw-r--r--bareos/fuse/node/joblog.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/bareos/fuse/node/job.py b/bareos/fuse/node/job.py
index 930921f..6bbc2cb 100644
--- a/bareos/fuse/node/job.py
+++ b/bareos/fuse/node/job.py
@@ -42,5 +42,5 @@ class Job(Directory):
def do_update(self):
self.add_subnode(File, name="info.txt", content = pformat(self.job) + "\n")
- self.add_subnode(JobLog, self.job)
+ self.add_subnode(JobLog, name="job.log", job=self.job)
self.add_subnode(BvfsDir, "data", self.job['jobid'], None)
diff --git a/bareos/fuse/node/joblog.py b/bareos/fuse/node/joblog.py
index e8b9122..e4249bb 100644
--- a/bareos/fuse/node/joblog.py
+++ b/bareos/fuse/node/joblog.py
@@ -5,14 +5,14 @@ Bareos specific Fuse node.
from bareos.fuse.node.file import File
class JobLog(File):
- def __init__(self, root, job):
- super(JobLog, self).__init__(root, "joblog.txt")
+ def __init__(self, root, name, job):
+ super(JobLog, self).__init__(root, name)
self.job = job
if job['jobstatus'] == 'T' or job['jobstatus'] == 'E' or job['jobstatus'] == 'W':
self.set_static()
@classmethod
- def get_id(cls, job):
+ def get_id(cls, name, job):
return job['jobid']
def do_update(self):
@@ -21,4 +21,8 @@ class JobLog(File):
self.content = ""
for i in data['joblog']:
self.content += str(i['time']) + " "
- self.content += str(i['logtext']) + "\n"
+ try:
+ self.content += str(i['logtext'])
+ except UnicodeEncodeError as e:
+ self.logger.error("failed to convert logtext to string: %s" % (str(e)))
+ self.content += "BAREOFSFS SKIPPED: converting error\n"