Ignore:
Timestamp:
Jun 2, 2008, 3:40:51 AM (16 years ago)
Author:
ecprice
Message:

Style adjustments (4-space indentation, no spaces inside parens).

File:
1 edited

Legend:

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

    r558 r561  
    1414
    1515def main(argv):
    16   # Query each of the server for their VMs.
    17   # TODO get `servers` from a real list of all the VM hosts (instead of
    18   # hardcoding the list here)
    19   servers = [ 'black-mesa.mit.edu', 'sx-blade-2.mit.edu' ]
    20   # XXX
    21   pipes = [ Popen(['remctl', server, 'remote', 'web', 'listvms'], stdout=PIPE)
    22             for server in servers ]
    23   outputs = [ p.communicate()[0] for p in pipes ]
    24   for p in pipes:
    25     if p.returncode != 0: raise CalledProcessError(p.returncode, cmd)
    26   results = [ safe_load(o) for o in outputs ]
    27   results = filter( lambda x: x is not None, results )
     16    # Query each of the server for their VMs.
     17    # TODO get `servers` from a real list of all the VM hosts (instead of
     18    # hardcoding the list here)
     19    servers = ['black-mesa.mit.edu', 'sx-blade-2.mit.edu']
     20    # XXX
     21    pipes = [Popen(['remctl', server, 'remote', 'web', 'listvms'], stdout=PIPE)
     22             for server in servers]
     23    outputs = [p.communicate()[0] for p in pipes]
     24    for p in pipes:
     25        if p.returncode != 0:
     26            raise CalledProcessError(p.returncode, cmd)
     27    results = [safe_load(o) for o in outputs]
     28    results = filter(lambda x: x is not None, results)
    2829
    29   # Merge the results and print.
    30   merged = {}
    31   for result in results: merged.update(result)
    32   print safe_dump(merged, default_flow_style=False)
     30    # Merge the results and print.
     31    merged = {}
     32    for result in results:
     33        merged.update(result)
     34    print safe_dump(merged, default_flow_style=False)
    3335
    3436if __name__ == '__main__':
    35   main(argv)
     37    main(argv)
    3638
    37 # vim:et:sw=2:ts=2
     39# vim:et:sw=2:ts=4
Note: See TracChangeset for help on using the changeset viewer.