summaryrefslogtreecommitdiff
path: root/tooz/drivers/file.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-23 20:09:59 +0000
committerGerrit Code Review <review@openstack.org>2016-11-23 20:09:59 +0000
commit6286b40eaeb9ab47277eb5284956f806b272de94 (patch)
tree2318b2e1897da4c14689133ab1e6cbb1e8f20248 /tooz/drivers/file.py
parentee27b133f50397198f8e31437a72732a7bd991aa (diff)
parent65f9f7a16a9884a4be9ce5d209d159ad8060cc52 (diff)
downloadtooz-6286b40eaeb9ab47277eb5284956f806b272de94.tar.gz
Merge "Raise tooz error when unexpected last entries found"
Diffstat (limited to 'tooz/drivers/file.py')
-rw-r--r--tooz/drivers/file.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tooz/drivers/file.py b/tooz/drivers/file.py
index c1fc12d..ef89a28 100644
--- a/tooz/drivers/file.py
+++ b/tooz/drivers/file.py
@@ -449,6 +449,11 @@ class FileDriver(coordination._RunWatchersMixin,
else:
if len(entries) > 1:
raise coordination.GroupNotEmpty(group_id)
+ elif len(entries) == 1 and entries != ['.metadata']:
+ raise coordination.ToozError(
+ "Unexpected path '%s' found in"
+ " group directory '%s' (expected to only find"
+ " a '.metadata' path)" % (entries[0], group_dir))
else:
try:
shutil.rmtree(group_dir)