From: Alex Dehnert Date: Sun, 25 Oct 2009 00:40:08 +0000 (-0400) Subject: Minor cleanup of monocast and LVM load balancer X-Git-Tag: 0.4.4~1 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/6c27d7937d0d2c6cc778f02b05abbbe286b01633 Minor cleanup of monocast and LVM load balancer svn path=/trunk/packages/invirt-remote/; revision=2513 --- diff --git a/debian/changelog b/debian/changelog index 174bcf0..db16eff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-remote (0.4.3) unstable; urgency=low + + * Minor cleanup of 0.4.2 + + -- Alex Dehnert Sat, 24 Oct 2009 17:12:33 -0400 + invirt-remote (0.4.2) unstable; urgency=low * Add "monocast" method to send remctl requests to exactly one diff --git a/python/remote/monocast.py b/python/remote/monocast.py index 1b39b57..033d154 100644 --- a/python/remote/monocast.py +++ b/python/remote/monocast.py @@ -4,7 +4,7 @@ import random hostnames = [ h.hostname for h in config.hosts ] -def monocast(args, hosts = hostnames, randomize = True): +def monocast(args, hostnames = hostnames, randomize = True): """ Given a command and a list of hostnames or IPs, issue the command to each node until it connects to one of the nodes. @@ -17,17 +17,15 @@ def monocast(args, hosts = hostnames, randomize = True): stderr of remctl """ if(randomize): - hosts = random.sample(hosts, len(hosts)) + hostnames = random.sample(hostnames, len(hostnames)) hostsdown = [] - for host in hosts: + for host in hostnames: pipe = Popen(['remctl', host, 'remote', 'web'] + args, stdout=PIPE, stderr=PIPE) output = pipe.communicate() if pipe.returncode != 0: if output[1].startswith('remctl: cannot connect to %s' % host): hostsdown.append(host) else: - #raise RuntimeError("remctl to host %s returned non-zero exit status %d; stderr:\n%s" - # % (host, pipe.returncode, output[1])) return (host, hostsdown, pipe.returncode,) + output else: return (host, hostsdown, pipe.returncode,) + output diff --git a/server/usr/sbin/invirt-remote-lvm b/server/usr/sbin/invirt-remote-lvm index 1c69107..ef86ae2 100755 --- a/server/usr/sbin/invirt-remote-lvm +++ b/server/usr/sbin/invirt-remote-lvm @@ -17,8 +17,7 @@ def main(argv): #print "Hostname: %s; down=%s" % (result[0], result[1]) sys.stdout.write(result[3]) # stdout sys.stderr.write(result[4]) # stderr + return 0 if __name__ == '__main__': sys.exit(main(sys.argv)) - -# vim:et:sw=4:ts=4 diff --git a/server/usr/sbin/invirt-remote-proxy b/server/usr/sbin/invirt-remote-proxy index e92e692..f5c5248 100755 --- a/server/usr/sbin/invirt-remote-proxy +++ b/server/usr/sbin/invirt-remote-proxy @@ -1,5 +1,5 @@ -#!/bin/bash -# invoke as invirt-remote-proxy-$TYPE, with "TYPE" in the remctl sense. +#!/bin/bash +# invoke as invirt-remote-proxy-$TYPE, with "TYPE" in the remctl sense. klist -s || kinit -k