Change in vdsm[master]: events: vm status notifications

nsoffer at redhat.com nsoffer at redhat.com
Tue May 19 19:52:38 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: events: vm status notifications
......................................................................


Patch Set 1:

(1 comment)

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

Line 866:     def _set_lastStatus(self, value):
Line 867:         with self._statusLock:
Line 868:             notification = self.cif.create_notification(
Line 869:                 '|virt|VM_status|' + self.id
Line 870:             )
Please do not use this indentation style in vdsm. Do you see other code in this module using this style?

Should be:

    notification = self.cif.create_notification(
        '|virt|VM_status|' + self.id)

Or better, create a function for creating virt notifications, accepting the notification name, as "virt" and self.id are the same for all notifications - right?

Also why the caller has to know the the internal format of the notification name (x|y|z)?
Line 871:             notification.emit(**{self.id: value})
Line 872:             if self._lastStatus == vmstatus.DOWN:
Line 873:                 self.log.warning(
Line 874:                     'trying to set state to %s when already Down',


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I746299f9f1e2f49831a05072f19af1d242796276
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list