Merge "Add a validate method to dir and memory backends"

This commit is contained in:
Jenkins
2014-02-04 04:58:10 +00:00
committed by Gerrit Code Review
2 changed files with 16 additions and 0 deletions

View File

@@ -95,6 +95,19 @@ class Connection(base.Connection):
# to restrict the multi-process access does not work inside a process.
self._lock = backend._lock
def validate(self):
# Verify key paths exist.
paths = [
self._backend.base_path,
self._backend.lock_path,
self._flow_path,
self._task_path,
self._book_path,
]
for p in paths:
if not os.path.isdir(p):
raise RuntimeError("Missing required directory: %s" % (p))
def _read_from(self, filename):
# This is very similar to the oslo-incubator fileutils module, but
# tweaked to not depend on a global cache, as well as tweaked to not

View File

@@ -78,6 +78,9 @@ class Connection(base.Connection):
def upgrade(self):
pass
def validate(self):
pass
@property
def backend(self):
return self._backend