Changeset 1598 for trunk


Ignore:
Timestamp:
Nov 10, 2008, 3:20:05 PM (16 years ago)
Author:
broder
Message:

Don't fail to execute remctls if a single server is down

Location:
trunk/packages/invirt-remote-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-remote-server/debian/changelog

    r1597 r1598  
    22
    33  * Include invirt.remote Python module
     4  * Ignore erroneous responses from a server if it's because the server is
     5    down
    46
    5  -- Evan Broder <broder@mit.edu>  Mon, 10 Nov 2008 15:15:13 -0500
     7 -- Evan Broder <broder@mit.edu>  Mon, 10 Nov 2008 15:19:28 -0500
    68
    79invirt-remote-server (0.0.14) unstable; urgency=low
  • trunk/packages/invirt-remote-server/python/remote/bcast.py

    r1597 r1598  
    1010    """
    1111    pipes = [(host,
    12               Popen(['remctl', host, 'remote', 'web', cmd], stdout=PIPE))
     12              Popen(['remctl', host, 'remote', 'web', cmd], stdout=PIPE, stderr=PIPE))
    1313             for host in hosts]
    14     outputs = [(s, p.communicate()[0]) for (s, p) in pipes]
     14    outputs = dict((s, p.communicate()) for (s, p) in pipes)
    1515    for (s, p) in pipes:
    1616        if p.returncode != 0:
    17             raise RuntimeError("remctl to host %s returned non-zero exit status %d"
    18                                % (s, p.returncode))
    19     return [(s, yaml.load(o, yaml.CSafeLoader)) for (s, o) in outputs]
     17            if outputs[s][1].startswith('remctl: cannot connect to %s' % s):
     18                del outputs[s]
     19            else:
     20                raise RuntimeError("remctl to host %s returned non-zero exit status %d"
     21                                   % (s, p.returncode))
     22    return [(s, yaml.load(o[1], yaml.CSafeLoader)) for (s, o) in outputs.iteritems()]
Note: See TracChangeset for help on using the changeset viewer.