- Timestamp:
- Jul 30, 2008, 10:13:02 PM (16 years ago)
- Location:
- trunk/packages/sipb-xen-base
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-base/debian/changelog
r794 r796 5 5 formatting composite nodes as yaml, allowing the root 6 6 * fix bug in late-import of yaml in invirt.config 7 7 * use yaml.CSafeDumper and yaml.CSafeLoader everywhere 8 8 9 [ Yang Zhang ] 9 10 * added shared lock around cache-reading transaction 10 11 11 -- Yang Zhang <y_z@mit.edu> Wed, 30 Jul 2008 21:56:07-040012 -- Greg Price <price@mit.edu> Wed, 30 Jul 2008 22:11:15 -0400 12 13 13 14 sipb-xen-base (8.11) unstable; urgency=low -
trunk/packages/sipb-xen-base/files/usr/sbin/invirt-getconf
r789 r796 80 80 else: 81 81 import yaml 82 yaml.safe_dump(conf, stdout, default_flow_style=False) 82 yaml.dump(conf, stdout, 83 Dumper=yaml.CSafeDumper, default_flow_style=False) 83 84 except invirt_exception, ex: 84 85 print >> stderr, ex -
trunk/packages/sipb-xen-base/files/usr/share/python-support/sipb-xen-base/invirt/config.py
r793 r796 35 35 @with_lock_file(lock_file, False) 36 36 def read_cache(): 37 try: ns.cfg = with_closing(file(cache_path))(lambda f: json.read(f.read())) 37 try: ns.cfg = with_closing(file(cache_path)) ( 38 lambda f: json.read(f.read())) 38 39 except: ns.do_refresh = True 39 40 … … 45 46 def refresh_cache(): 46 47 import yaml 47 try: default_loader = yaml.CSafeLoader48 except: default_loader = yaml.SafeLoader49 ns.cfg = with_closing(file(src_path))(lambda f: yaml.load(f, default_loader))50 try: with_closing(file(cache_path, 'w'))(lambda f: f.write(json.write(ns.cfg)))48 ns.cfg = with_closing(file(src_path)) ( 49 lambda f: yaml.load(f, yaml.CSafeLoader)) 50 try: with_closing(file(cache_path, 'w')) ( 51 lambda f: f.write(json.write(ns.cfg))) 51 52 except: pass # silent failure 52 53 return ns.cfg
Note: See TracChangeset
for help on using the changeset viewer.