summaryrefslogtreecommitdiffstats
path: root/qtip/loader
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/loader
parent5f03a1d2e5c9bf03ccdb7dc98f0429695e5e315c (diff)
parent245b6f4070d1b3b5124a184cb6442b55000fd321 (diff)
Merge "Fix bug when no paths is given for Plan constructor"
Diffstat (limited to 'qtip/loader')
-rw-r--r--qtip/loader/file.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/qtip/loader/file.py b/qtip/loader/file.py
index 038f57dd..a39e15f6 100644
--- a/qtip/loader/file.py
+++ b/qtip/loader/file.py
@@ -28,11 +28,12 @@ class FileLoader(BaseLoader):
self._filename = name
self.abspath = self.find(name, paths=paths)
- def find(self, name, paths=None):
+ @classmethod
+ def find(cls, name, paths=None):
"""find a specification in searching paths"""
- paths = [self.abspath] if paths is None else paths
+ paths = cls._paths if paths is None else paths
for p in paths:
- abspath = path.join(p, self.RELATIVE_PATH, name)
+ abspath = path.join(p, cls.RELATIVE_PATH, name)
if path.exists(abspath):
return abspath
raise NotFoundError(name, paths)