Changeset 563
- Timestamp:
- Jun 2, 2008, 4:39:16 AM (17 years ago)
- Location:
- trunk/packages
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms
r553 r563 44 44 else: 45 45 import yaml 46 print yaml. safe_dump(vms, default_flow_style=False)46 print yaml.dump(vms, Dumper=yaml.CDumper, default_flow_style=False) -
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 -
trunk/packages/sipb-xen-www/code/controls.py
r554 r563 141 141 """Return a dictionary mapping machine names to dicts.""" 142 142 value_string = remctl('web', 'listvms') 143 value_dict = yaml. safe_load(value_string)143 value_dict = yaml.load(value_string, yaml.CSafeLoader) 144 144 return value_dict 145 145
Note: See TracChangeset
for help on using the changeset viewer.