Change in vdsm[master]: stats: return HA agent score when applicable

vfeenstr at redhat.com vfeenstr at redhat.com
Thu Oct 17 10:14:05 UTC 2013


Vinzenz Feenstra has posted comments on this change.

Change subject: stats: return HA agent score when applicable
......................................................................


Patch Set 4:

(2 comments)

....................................................
File vdsm/API.py
Line 1188:         def _getHaScore():
Line 1189:             if ha_agent:
Line 1190:                 try:
Line 1191:                     return ha_client.HAClient().get_local_host_score()
Line 1192:                 except:
Please specify which exceptions to catch
Line 1193:                     pass
Line 1194:             return False
Line 1195: 
Line 1196:         def _readSwapTotalFree():


Line 1225:         stats['generationID'] = self._cif._generationID
Line 1226: 
Line 1227:         haScore = _getHaScore()
Line 1228:         if haScore is not False:
Line 1229:             stats['haScore'] = haScore
I'd make this shorter by doing it like this:

_addHaScore(stats)


and instead of _getHaScore() =>

def _addHaScore(stats):
if ha_agent:
    try:
        stats['haScore'] = ha_client.HAClient().get_local_host_score()
    except Exception: # Better even a more specific exception
         pass
Line 1230: 
Line 1231:         return {'status': doneCode, 'info': stats}
Line 1232: 
Line 1233:     def setLogLevel(self, level):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibdad8accb0660dbdcc8b6e1b83f491c2f89c2d30
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list