If normal file storage was disabled but shared storage enabled,
“_TransformFileStorageDir” would still throw an exception.

in “opcodes._CheckStorageType” there's also a check, but I wasn't quite
sure what the correct way of handling it was, so I added a TODO comment.
---
 lib/backend.py |    3 ++-
 lib/opcodes.py |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/backend.py b/lib/backend.py
index dc1378f..07ffa75 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -2702,7 +2702,8 @@ def _TransformFileStorageDir(fs_dir):
   @return: the normalized path if valid, None otherwise
 
   """
-  if not constants.ENABLE_FILE_STORAGE:
+  if not (constants.ENABLE_FILE_STORAGE or
+          constants.ENABLE_SHARED_FILE_STORAGE):
     _Fail("File storage disabled at configure time")
   cfg = _GetConfig()
   fs_dir = os.path.normpath(fs_dir)
diff --git a/lib/opcodes.py b/lib/opcodes.py
index dba9fd5..8a88bf0 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -334,6 +334,7 @@ def _CheckStorageType(storage_type):
     raise errors.OpPrereqError("Unknown storage type: %s" % storage_type,
                                errors.ECODE_INVAL)
   if storage_type == constants.ST_FILE:
+    # TODO: What about shared file storage?
     RequireFileStorage()
   return True
 
-- 
1.7.7.3

Reply via email to