This was never used from its introduction in 9c1c3c198cc6a2a2.
Signed-off-by: Brian Foley <[email protected]>
---
lib/storage/filestorage.py | 16 ----------------
test/py/ganeti.storage.filestorage_unittest.py | 16 ----------------
2 files changed, 32 deletions(-)
diff --git a/lib/storage/filestorage.py b/lib/storage/filestorage.py
index 74234e8..80d9e7c 100644
--- a/lib/storage/filestorage.py
+++ b/lib/storage/filestorage.py
@@ -455,22 +455,6 @@ def CheckFileStoragePathAcceptance(
_CheckFileStoragePath(path, allowed, exact_match_ok=exact_match_ok)
-def _CheckFileStoragePathExistance(path):
- """Checks whether the given path is usable on the file system.
-
- This checks wether the path is existing, a directory and writable.
-
- @type path: string
- @param path: path to check
-
- """
- if not os.path.isdir(path):
- raise errors.FileStoragePathError("Path '%s' does not exist or is not a"
- " directory." % path)
- if not os.access(path, os.W_OK):
- raise errors.FileStoragePathError("Path '%s' is not writable" % path)
-
-
def CheckFileStoragePath(
path, _allowed_paths_file=pathutils.FILE_STORAGE_PATHS_FILE):
"""Checks whether the path exists and is acceptable to use.
diff --git a/test/py/ganeti.storage.filestorage_unittest.py
b/test/py/ganeti.storage.filestorage_unittest.py
index 4ac5743..1bf83ff 100755
--- a/test/py/ganeti.storage.filestorage_unittest.py
+++ b/test/py/ganeti.storage.filestorage_unittest.py
@@ -77,22 +77,6 @@ class TestCheckFileStoragePath(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
- def testCheckFileStoragePathExistance(self):
- filestorage._CheckFileStoragePathExistance(self.tmpdir)
-
- def testCheckFileStoragePathExistanceFail(self):
- path = os.path.join(self.tmpdir, "does/not/exist")
- self.assertRaises(errors.FileStoragePathError,
- filestorage._CheckFileStoragePathExistance, path)
-
- def testCheckFileStoragePathNotWritable(self):
- path = os.path.join(self.tmpdir, "isnotwritable/")
- os.mkdir(path)
- os.chmod(path, 0)
- self.assertRaises(errors.FileStoragePathError,
- filestorage._CheckFileStoragePathExistance, path)
- os.chmod(path, 777)
-
def testCheckFileStoragePath(self):
path = os.path.join(self.allowed_paths[0], "allowedsubdir")
os.mkdir(path)
--
2.8.0.rc3.226.g39d4020