Change in vdsm[master]: mounts: Use more meaningful names
nsoffer at redhat.com
nsoffer at redhat.com
Sun Apr 24 23:43:10 UTC 2016
Nir Soffer has uploaded a new change for review.
Change subject: mounts: Use more meaningful names
......................................................................
mounts: Use more meaningful names
Rename the constants and functions for un-escaping spaces to make the
intent of the code more clear.
Change-Id: Iac1ba474856c9cf9f66d05dcce7ed152cbe2147b
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M lib/vdsm/storage/mount.py
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/56551/1
diff --git a/lib/vdsm/storage/mount.py b/lib/vdsm/storage/mount.py
index 00ddf43..8379931 100644
--- a/lib/vdsm/storage/mount.py
+++ b/lib/vdsm/storage/mount.py
@@ -48,7 +48,7 @@
_SYS_DEV_BLOCK_PATH = '/sys/dev/block/'
_DELETED_SUFFIX = ' (deleted)'
-_RE_ESCAPE = re.compile(r"\\[0-7]{3}")
+_ESCAPED_SPACES = re.compile(r"\\[0-7]{3}")
def _parseFstabLine(line):
@@ -57,19 +57,19 @@
fs_mntops = fs_mntops.split(",")
fs_freq = int(fs_freq)
fs_passno = int(fs_passno)
- fs_spec = normpath(_parseFstabPath(fs_spec))
+ fs_spec = normpath(_unescape_spaces(fs_spec))
if fs_file.endswith(_DELETED_SUFFIX):
fs_file = fs_file[:-len(_DELETED_SUFFIX)]
- fs_file = normpath(_parseFstabPath(fs_file))
+ fs_file = normpath(_unescape_spaces(fs_file))
return MountRecord(fs_spec, fs_file, fs_vfstype, fs_mntops,
fs_freq, fs_passno)
-def _parseFstabPath(path):
- return _RE_ESCAPE.sub(lambda s: chr(int(s.group()[1:], 8)), path)
+def _unescape_spaces(path):
+ return _ESCAPED_SPACES.sub(lambda s: chr(int(s.group()[1:], 8)), path)
class MountError(RuntimeError):
--
To view, visit https://gerrit.ovirt.org/56551
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac1ba474856c9cf9f66d05dcce7ed152cbe2147b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
More information about the vdsm-patches
mailing list