Revision 5e09a309 lib/backend.py
b/lib/backend.py | ||
---|---|---|
2743 | 2743 |
if not (constants.ENABLE_FILE_STORAGE or |
2744 | 2744 |
constants.ENABLE_SHARED_FILE_STORAGE): |
2745 | 2745 |
_Fail("File storage disabled at configure time") |
2746 |
cfg = _GetConfig() |
|
2747 |
fs_dir = os.path.normpath(fs_dir) |
|
2748 |
base_fstore = cfg.GetFileStorageDir() |
|
2749 |
base_shared = cfg.GetSharedFileStorageDir() |
|
2750 |
if not (utils.IsBelowDir(base_fstore, fs_dir) or |
|
2751 |
utils.IsBelowDir(base_shared, fs_dir)): |
|
2752 |
_Fail("File storage directory '%s' is not under base file" |
|
2753 |
" storage directory '%s' or shared storage directory '%s'", |
|
2754 |
fs_dir, base_fstore, base_shared) |
|
2755 |
return fs_dir |
|
2746 |
|
|
2747 |
bdev.CheckFileStoragePath(fs_dir) |
|
2748 |
|
|
2749 |
return os.path.normpath(fs_dir) |
|
2756 | 2750 |
|
2757 | 2751 |
|
2758 | 2752 |
def CreateFileStorageDir(file_storage_dir): |
Also available in: Unified diff