- Timestamp:
- Jun 2, 2008, 4:39:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-remote-server/files/usr/sbin/sipb-xen-remote-listvms
r562 r563 6 6 """ 7 7 8 from itertools import chain9 8 from subprocess import PIPE, Popen 10 9 try: … … 21 20 def __str__(self): 22 21 return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) 23 from sys import argv, stdout 24 from yaml import safe_dump, safe_load 22 import sys 23 import yaml 25 24 26 25 ### … … 38 37 if p.returncode != 0: 39 38 raise CalledProcessError(p.returncode, cmd) 40 results = [ safe_load(o) for o in outputs]39 results = [yaml.load(o, yaml.CSafeLoader) for o in outputs] 41 40 results = filter(lambda x: x is not None, results) 42 41 … … 45 44 for result in results: 46 45 merged.update(result) 47 print safe_dump(merged, default_flow_style=False)46 print yaml.dump(merged, Dumper=yaml.CDumper, default_flow_style=False) 48 47 49 48 if __name__ == '__main__': 50 main( argv)49 main(sys.argv) 51 50 52 51 # vim:et:sw=2:ts=4
Note: See TracChangeset
for help on using the changeset viewer.