Nir Soffer has posted comments on this change.

Change subject: Introduction for caching the parsed domain XML
......................................................................


Patch Set 22:

(2 comments)

Nice but see comments in 
http://gerrit.ovirt.org/#/c/17694/22/vdsm/virt/domain_descriptor.py

http://gerrit.ovirt.org/#/c/17694/22/vdsm/virt/domain_descriptor.py
File vdsm/virt/domain_descriptor.py:

Line 19: #
Line 20: import xml.dom.minidom
Line 21: 
Line 22: 
Line 23: class DomainDescriptor(object):
Blank line bellow the class is common and make it even nicer.
Line 24:     def __init__(self, xmlStr):
Line 25:         self._xml = xmlStr
Line 26:         self._dom = xml.dom.minidom.parseString(xmlStr)
Line 27:         self._devices = self.firstElementByTagName('devices')


Line 29:         self._devicesHash = str(hash(self._devices)) if self._devices 
else '0'
Line 30: 
Line 31:     @staticmethod
Line 32:     def fromId(uuid):
Line 33:         return DomainDescriptor('<domain><uuid>%s</uuid></domain>' % 
uuid)
Should be class method:

    @classmethod
    def fromId(cls, uuid):
        retrn cls("...")

So if you subclass this you will create your subclass, not the superclass.
Line 34: 
Line 35:     @property
Line 36:     def xml(self):
Line 37:         return self._xml


-- 
To view, visit http://gerrit.ovirt.org/17694
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7e106b2f2d3f4160d4e882f1a2880cb1b52fbb22
Gerrit-PatchSet: 22
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to