Commit 17c61836 authored by Guido Trotter's avatar Guido Trotter
Browse files

IsNormAbsPath and users, use "normalized" term



We used to refer to normalized paths as "normal" which might be
confusing. This fixes the syntax in all current IsNormAbsPath users and
in the docstring.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 4f5277e7
......@@ -49,11 +49,11 @@ from ganeti import utils
# _CHECK values
# must be afile
_FILE_CHECK = (utils.IsNormAbsPath, "must be an absolute normal path",
_FILE_CHECK = (utils.IsNormAbsPath, "must be an absolute normalized path",
os.path.isfile, "not found or not a file")
# must be a directory
_DIR_CHECK = (utils.IsNormAbsPath, "must be an absolute normal path",
_DIR_CHECK = (utils.IsNormAbsPath, "must be an absolute normalized path",
os.path.isdir, "not found or not a directory")
# nice wrappers for users
......
......@@ -1786,7 +1786,7 @@ def SetupLogging(logfile, debug=False, stderr_logging=False, program="",
raise
def IsNormAbsPath(path):
"""Check whether a path is absolute and also "normal".
"""Check whether a path is absolute and also normalized
This avoids things like /dir/../../other/path to be valid.
......
......@@ -975,10 +975,10 @@ class TestIsAbsNormPath(unittest.TestCase):
def _pathTestHelper(self, path, result):
if result:
self.assert_(IsNormAbsPath(path),
"Path %s should be absolute and normal" % path)
"Path %s should result absolute and normalized" % path)
else:
self.assert_(not IsNormAbsPath(path),
"Path %s should not be absolute and normal" % path)
"Path %s should not result absolute and normalized" % path)
def testBase(self):
self._pathTestHelper('/etc', True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment