Igor Lvovsky has posted comments on this change.
Change subject: isMounted() now handles / at end of export in certain distros
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File vdsm/storage/fileUtils.py
Line 154: return True
Line 155:
Line 156: return False
Line 157:
Line 158: def isMounted(resource=None, mountPoint=None, mountType=None):
Default should be empty string and simplify the lambda below.
Line 159: """
Line 160: Verify that "resource" (if given) is mounted on
"mountPoint"
Line 161: """
Line 162: if mountPoint is None and resource is None:
Line 158: def isMounted(resource=None, mountPoint=None, mountType=None):
Line 159: """
Line 160: Verify that "resource" (if given) is mounted on
"mountPoint"
Line 161: """
Line 162: if mountPoint is None and resource is None:
Better:
if not mountPoint and not resource
Line 163: raise ValueError("`mountPoint` or `resource` must be
specified")
Line 164:
Line 165: cleanPath = lambda path: path[:-1] if path is not None and
path.endswith("/") else path
Line 166:
Line 173: (res, mp, fs) = m[0:3]
Line 174: res = cleanPath(res)
Line 175: mp = cleanPath(mp)
Line 176:
Line 177: if ( (mountPoint is None or mp == mountPoint)
Same as above, remove None's
Line 178: and (resource is None or res == resource)
Line 179: and (mountType is None or fs.startswith(mountType)) ):
Line 180: return True
Line 181:
--
To view, visit
http://gerrit.usersys/1072
To unsubscribe, visit
http://gerrit.usersys/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1cbba23b8a2d89a037ba809a86591ab33239ce24
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>