Change in vdsm[master]: periodic: ignore known-benign libvirt errors

mpolednik at redhat.com mpolednik at redhat.com
Tue Feb 2 09:03:15 UTC 2016


Martin Polednik has posted comments on this change.

Change subject: periodic: ignore known-benign libvirt errors
......................................................................


Patch Set 5: Code-Review-1

(2 comments)

I don't know what libvirt.VIR_ERR_OPERATION_UNSUPPORTED means in this context. Please add a *comment* explaining why is it needed.

https://gerrit.ovirt.org/#/c/52884/5/tests/periodicTests.py
File tests/periodicTests.py:

Line 331:     def __init__(self, vmId, vmName):
Line 332:         self.id = vmId
Line 333:         self.name = vmName
Line 334:         self.migrating = False
Line 335:         self.lastStatus = vmstatus.UP
minor: Although not required currently, I'd consider moving the defaults to constructor args. Minor as that would invalidate the comment above and could raise a question of _FakeVM vs fake.VM.
Line 336: 
Line 337:     def isMigrating(self):
Line 338:         return self.migrating
Line 339: 


https://gerrit.ovirt.org/#/c/52884/5/vdsm/virt/periodic.py
File vdsm/virt/periodic.py:

Line 297:             if e.get_error_code() in (libvirt.VIR_ERR_NO_DOMAIN,
Line 298:                                       libvirt.VIR_ERR_OPERATION_UNSUPPORTED,):
Line 299:                 # known benign cases: migration in progress or completed
Line 300:                 if migrating or self._vm.lastStatus == vmstatus.DOWN:
Line 301:                     return
It may be nicer to use only a single condition keyword and with correct newlines insert a comment above each constant that may not be obvious. Example:

if (e.get_error_code() in
    # comment explaining this error code
    (libvirt.VIR_ERR_NO_DOMAIN,
     # comment explaining this error code
     libvirt.VIR_ERR_OPERATION_UNSUPPORTED,) and
    # known benign cases: migration in progress or completed
        migrating or self._vm.lastStatus == vmstatus.DOWN):

    return
Line 302:             raise
Line 303: 
Line 304:     def _execute(self):
Line 305:         raise NotImplementedError


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb5618f44870bdca97fa479734514a3c8d81c7d7
Gerrit-PatchSet: 5
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: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list