Change in vdsm[master]: virt: rng: Rng device should not depend on caps.py

mzamazal at redhat.com mzamazal at redhat.com
Wed Feb 24 13:25:56 UTC 2016


Milan Zamazal has posted comments on this change.

Change subject: virt: rng: Rng device should not depend on caps.py
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

Good change, just some stylistic issues.

https://gerrit.ovirt.org/#/c/53558/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 4156: 
Line 4157:             for dev in self.conf['devices']:
Line 4158:                 if dev['type'] == hwclass.RNG and \
Line 4159:                    vmdevices.core.Rng.configured_for(dev, source) \
Line 4160:                    and 'alias' not in dev:
Please move `and' to the end of the previous line to be consistent inside the condition.
Line 4161:                     dev['address'] = address
Line 4162:                     dev['alias'] = alias
Line 4163:                     break
Line 4164: 


https://gerrit.ovirt.org/#/c/53558/1/vdsm/virt/vmdevices/core.py
File vdsm/virt/vmdevices/core.py:

Line 246:             if os.path.exists(path)
Line 247:         ]
Line 248: 
Line 249:     @staticmethod
Line 250:     def configured_for(conf, source):
I don't like the method name, but I can't suggest a better one. What (Rng?) is configured for what?
Line 251:         return Rng._SOURCES[conf['specParams']['source']] == source
Line 252: 
Line 253:     def uses(self, source):
Line 254:         return self._SOURCES[self.specParams['source']] == source


Line 249:     @staticmethod
Line 250:     def configured_for(conf, source):
Line 251:         return Rng._SOURCES[conf['specParams']['source']] == source
Line 252: 
Line 253:     def uses(self, source):
Maybe the method name could be more specific, e.g. uses_source?
Line 254:         return self._SOURCES[self.specParams['source']] == source
Line 255: 
Line 256:     def getXML(self):
Line 257:         """


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If74f6c262f6a0bd4ed6a968e17e883e1e264ed54
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list