summaryrefslogtreecommitdiff
path: root/taskflow/persistence
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-09-04 11:08:11 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-09-04 11:20:24 -0700
commitf6450d9d6b848c59c0ca0fa1fc95f0e5eae1a1fe (patch)
treeadbf9d377819196a390cdd50ce236837d24d72be /taskflow/persistence
parentcd122d84d92e9e07842013fe148d0c399d28ec4b (diff)
downloadtaskflow-f6450d9d6b848c59c0ca0fa1fc95f0e5eae1a1fe.tar.gz
Fix how the dir persistence backend was not listing logbooks
Due to the usage of the os.path.islink check this means that no logbooks would be returned when get_logbooks was called, which is not the behavior we want. Closes-Bug: #1492403 Change-Id: Ife6a5bec777c9e2d820391914ce2c6fbbadf4f79
Diffstat (limited to 'taskflow/persistence')
-rw-r--r--taskflow/persistence/backends/impl_dir.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/taskflow/persistence/backends/impl_dir.py b/taskflow/persistence/backends/impl_dir.py
index f91c4e7..9d7b3ca 100644
--- a/taskflow/persistence/backends/impl_dir.py
+++ b/taskflow/persistence/backends/impl_dir.py
@@ -136,9 +136,13 @@ class Connection(path_based.PathBasedConnection):
shutil.rmtree(path)
def _get_children(self, path):
+ if path == self.book_path:
+ filter_func = os.path.isdir
+ else:
+ filter_func = os.path.islink
with _storagefailure_wrapper():
- return [link for link in os.listdir(path)
- if os.path.islink(self._join_path(path, link))]
+ return [child for child in os.listdir(path)
+ if filter_func(self._join_path(path, child))]
def _ensure_path(self, path):
with _storagefailure_wrapper():