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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.