aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/collector/logfile.py
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-27 13:44:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-27 13:44:21 +0000
commit2d18b85a64866047cd1df96e29373054d2c8de3e (patch)
tree7a0e9a1f2d270010e6df8118e0913dc8552f53ff /qtip/collector/logfile.py
parent5f03a1d2e5c9bf03ccdb7dc98f0429695e5e315c (diff)
parent245b6f4070d1b3b5124a184cb6442b55000fd321 (diff)
Merge "Fix bug when no paths is given for Plan constructor"
Diffstat (limited to 'qtip/collector/logfile.py')
-rw-r--r--qtip/collector/logfile.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/qtip/collector/logfile.py b/qtip/collector/logfile.py
index 2c2e532f..5f0951cb 100644
--- a/qtip/collector/logfile.py
+++ b/qtip/collector/logfile.py
@@ -18,8 +18,8 @@ from qtip.loader.file import FileLoader
class LogItem(BaseActor):
- def find(self, filename, paths=None):
- return self._parent.find(filename, paths)
+ def find(self, filename):
+ return self._parent.find(filename)
class LogfileCollector(BaseActor):
@@ -33,8 +33,7 @@ class LogfileCollector(BaseActor):
self._parent = parent # plan
# TODO(yujunz) handle exception of invalid parent
dirname = os.path.dirname(self._parent.abspath)
- paths = [os.path.join(dirname, p) for p in config.get(self.PATHS, [])]
- self._loader = FileLoader('.', paths)
+ self.paths = [os.path.join(dirname, p) for p in config.get(self.PATHS, [])]
def run(self):
collected = []
@@ -45,8 +44,8 @@ class LogfileCollector(BaseActor):
collected = chain(collected, reduce(chain, matches))
return reduce(merge_matchobj_to_dict, collected, {'groups': (), 'groupdict': {}})
- def find(self, filename, paths=None):
- return self._loader.find(filename, paths)
+ def find(self, filename):
+ return FileLoader.find(filename, self.paths)
def merge_matchobj_to_dict(d, m):