Changeset 563 for trunk/packages


Ignore:
Timestamp:
Jun 2, 2008, 4:39:16 AM (17 years ago)
Author:
andersk
Message:

TURBOYAML!!1

Location:
trunk/packages
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms

    r553 r563  
    4444    else:
    4545        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  
    66"""
    77
    8 from itertools import chain
    98from subprocess import PIPE, Popen
    109try:
     
    2120        def __str__(self):
    2221            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
     22import sys
     23import yaml
    2524
    2625###
     
    3837        if p.returncode != 0:
    3938            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]
    4140    results = filter(lambda x: x is not None, results)
    4241
     
    4544    for result in results:
    4645        merged.update(result)
    47     print safe_dump(merged, default_flow_style=False)
     46    print yaml.dump(merged, Dumper=yaml.CDumper, default_flow_style=False)
    4847
    4948if __name__ == '__main__':
    50     main(argv)
     49    main(sys.argv)
    5150
    5251# vim:et:sw=2:ts=4
  • trunk/packages/sipb-xen-www/code/controls.py

    r554 r563  
    141141    """Return a dictionary mapping machine names to dicts."""
    142142    value_string = remctl('web', 'listvms')
    143     value_dict = yaml.safe_load(value_string)
     143    value_dict = yaml.load(value_string, yaml.CSafeLoader)
    144144    return value_dict
    145145
Note: See TracChangeset for help on using the changeset viewer.