Eduardo has posted comments on this change.
Change subject: Distinguish between local and mounted SD's.
......................................................................
Patch Set 1: (2 inline comments)
Sorry, the answer remained as draft.
....................................................
File vdsm/storage/localFsSD.py
Line 106: # TODO: This function should be removed when the mangled mangling
name scheme
Line 107: # of mounted (nfs, Posix) SD's and local SD's is fixed but...
Line 108: # Is better to remove completely the localFS SD's concept, but...
Line 109: # this will not fixed by now
Line 110: def isLocalFsDomain(sdUUID):
os.path.ismount(path) returns True only if path is the mount point and False
for child dirs.
Is better to avoid trimming the path.
e.g.
>>>
os.path.ismount("/rhev/data-center/mnt/dog:_volumes_dog_Df__New__Export__0__nfs__71122241851338")
True
>>> os.path.ismount("/rhev/data-center/mnt/dog:_volumes_dog_Df__New__Export__0__nfs__71122241851338/72ec1321-a114-451f-bee1-6790cbca1bc6")
False
Line 111: """This ancillary function differentiates local and mounted SD's.
Line 112:
Line 113: Assumed that a local SD can't be mounted.
Line 114: mounted: nfs, posixFS
Line 117: mtab = open("/etc/mtab", "r").readlines()
Line 118: for mEntry in mtab:
Line 119: if sdUUID in mEntry:
Line 120: # This is a mounted domain therefore not exists as a
local SD.
Line 121: isLocal = False
IMHO is better to have only one exit point of the function.
Line 122: break
Line 123: else:
Line 124: isLocal = True
Line 125: return isLocal
--
To view, visit http://gerrit.ovirt.org/10024
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I12b5ba80121b8e8d23a63ecc7aaab829bfc67a51
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Paikov <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Haim Ateya <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches