Sandro Bonazzola has posted comments on this change.
Change subject: WIP ovirt-hosted-engine-ha: initial commit
......................................................................
Patch Set 6: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File src/broker/submonitorBase.py
Line 42: HA configurations requiring results from that submonitor.
Line 43: """
Line 44: raise NotImplementedError("Submonitor plugin error: "
Line 45: "register method not implemented")
Line 46:
trailing spaces
Line 47: def action(self, options):
Line 48: """
Line 49: Action for submonitor plugins; must be overridden by subclass.
Each
Line 50: submonitor should compute their result, then call
self.updateResult().
....................................................
File src/broker/submonitors/cpuLoad.py
Line 31: p = subprocess.Popen(['cat', '/proc/cpuinfo'],
stdout=subprocess.PIPE)
Line 32: out = p.communicate()[0]
Line 33: if p.wait() == 0:
Line 34: ncpus = len([True for c in out.split("\n")
Line 35: if len(c.split()) and c.split()[0] ==
'processor'])
why not just open /proc/loadavg and read it?
Line 36: p = subprocess.Popen(['cat', '/proc/loadavg'],
stdout=subprocess.PIPE)
Line 37: out = p.communicate()[0]
Line 38: if p.wait() == 0:
Line 39: loadAvg = float(out.split()[0])
....................................................
File src/broker/submonitors/ping.py
Line 34: timeout = options.get('timeout', 10)
Line 35: if ip is None:
Line 36: raise Exception("ping requires ip address")
Line 37: log.debug("IP={0}, timeout={1}".format(ip, timeout))
Line 38:
trailing spaces
Line 39: with open(os.devnull, "w") as devnull:
Line 40: p = subprocess.Popen(['ping', '-c', '1', '-W',
str(timeout), ip],
Line 41: stdout=devnull, stderr=devnull)
Line 42: if p.wait() != 0:
--
To view, visit http://gerrit.ovirt.org/16462
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3853db529ed353e7d5080692029ab80262a02c91
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches