Changeset 721


Ignore:
Timestamp:
Jul 24, 2008, 9:42:18 PM (16 years ago)
Author:
price
Message:

fix another race in remctl interface

This had caused some 500s with a message 'Error: Domain <...> does not exist.'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remote-server/files/usr/sbin/sipb-xen-remote-control

    r625 r721  
    2424    if machine_name not in vms:
    2525        print >>sys.stderr, "machine '%s' is not on" % machine_name
    26         return 2
     26        return 1
    2727    host = vms[machine_name]['host']
    2828
    29     return call(['remctl', host, 'remote', 'control'] + argv[1:])
     29    p = Popen(['remctl', host, 'remote', 'control'] + argv[1:],
     30              stdout=PIPE, stderr=PIPE)
     31    (out, err) = p.communicate()
     32    if p.returncode == 1:
     33        print >>sys.stderr, "machine '%s' is not on" % machine_name
     34        return 1
     35    sys.stderr.write(err)
     36    sys.stdout.write(out)
     37    return p.returncode
    3038
    3139if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.