Michal Skrivanek has posted comments on this change.

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


Patch Set 15:

(2 comments)

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

Line 382:                 self._lastStatus = value
Line 383:                 vm_status = self._getVmStatus()
Line 384:                 self._send_status_event(vm_status['status'])
Line 385: 
Line 386:     def _send_status_event(self, value):
in all cases we are sending the same "value" (the same applies to the guest 
agent's status in the next patch) result of _getVmStatus()...can't we hide it 
within the function and simplify the callers then?
Line 387:         stats = {
Line 388:             'status': value,
Line 389:             'hash': str(hash((self._domain.devices_hash,
Line 390:                               self.guestAgent.diskMappingHash))),


Line 390:                               self.guestAgent.diskMappingHash))),
Line 391:             'elapsedTime': str(int(time.time() - self._startTime)),
Line 392:         }
Line 393: 
Line 394:         if value == vmstatus.DOWN:
as commented before, we could just use _getExitedVmStats
Line 395:             if 'exitCode' in self.conf:
Line 396:                 stats['exitCode'] = self.conf['exitCode']
Line 397:             if 'exitMessage' in self.conf:
Line 398:                 stats['exitMessage'] = self.conf['exitMessage']


-- 
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: 15
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dima Kuznetsov <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[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