Nir Soffer has posted comments on this change.

Change subject: StorageDomainManifest: introduce class heirarchy
......................................................................


Patch Set 2:

(7 comments)

https://gerrit.ovirt.org/#/c/41993/2/vdsm/storage/blockSD.py
File vdsm/storage/blockSD.py:

Line 409:         return stats['seconds']
Line 410: 
Line 411: 
Line 412: class BlockStorageDomain(sd.StorageDomain):
Line 413:     ManifestClass = BlockStorageDomainManifest
manifestClass ?
Line 414: 
Line 415:     def __init__(self, sdUUID):
Line 416:         manifest = self.ManifestClass(sdUUID)
Line 417:         sd.StorageDomain.__init__(self, manifest)


https://gerrit.ovirt.org/#/c/41993/2/vdsm/storage/fileSD.py
File vdsm/storage/fileSD.py:

Line 156
Line 157
Line 158
Line 159
Line 160
Why did you remove this?


Line 146: 
Line 147: 
Line 148: class FileStorageDomainManifest(sd.StorageDomainManifest):
Line 149:     def __init__(self, domainPath):
Line 150:         sdUUID = os.path.basename(domainPath)
Why did you move this here? we use it only on line 158?
Line 151: 
Line 152:         # Using glob might look like the simplest thing to do but it 
isn't
Line 153:         # If one of the mounts is stuck it'll cause the entire glob 
to fail
Line 154:         # and you wouldn't be able to access any domain


Line 154:         # and you wouldn't be able to access any domain
Line 155:         self.log.debug("Reading domain in path %s", domainPath)
Line 156:         self.mountpoint = os.path.dirname(domainPath)
Line 157:         self.remotePath = os.path.basename(self.mountpoint)
Line 158:         domaindir = os.path.join(self.mountpoint, sdUUID)
Why did you move this here? We use this only in line 162?
Line 159:         self.metafile = os.path.join(domainPath, sd.DOMAIN_META_DATA,
Line 160:                                      sd.METADATA)
Line 161:         metadata = FileSDMetadata(self.metafile)
Line 162:         sd.StorageDomainManifest.__init__(self, sdUUID, domaindir, 
metadata)


Line 169:         return stats['seconds']
Line 170: 
Line 171: 
Line 172: class FileStorageDomain(sd.StorageDomain):
Line 173:     ManifestClass = FileStorageDomainManifest
It is common to use mixedCase for class attributes, and not CammelCase.
Line 174: 
Line 175:     def __init__(self, domainPath):
Line 176:         manifest = self.ManifestClass(domainPath)
Line 177:         validateFileSystemFeatures(manifest.sdUUID, 
manifest.mountpoint)


Line 173:     ManifestClass = FileStorageDomainManifest
Line 174: 
Line 175:     def __init__(self, domainPath):
Line 176:         manifest = self.ManifestClass(domainPath)
Line 177:         validateFileSystemFeatures(manifest.sdUUID, 
manifest.mountpoint)
Any reason to keep this in FileStorageDomain? This is again about the menifast 
attributes.
Line 178:         sd.StorageDomain.__init__(self, manifest)
Line 179: 
Line 180:         self.imageGarbageCollector()
Line 181:         self._registerResourceNamespaces()


https://gerrit.ovirt.org/#/c/41993/2/vdsm/storage/sd.py
File vdsm/storage/sd.py:

Line 338:     def domaindir(self):
Line 339:         return self._manifest.domaindir
Line 340: 
Line 341:     @property
Line 342:     def _metadata(self):
A TODO: comment about removing this property when we are done would be nice.
Line 343:         return self._manifest._metadata
Line 344: 
Line 345:     @property
Line 346:     def mountpoint(self):


-- 
To view, visit https://gerrit.ovirt.org/41993
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia275424a8d423722efb229a4d8545f035fe5fa51
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Ala Hino <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Freddy Rolland <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to