Changeset 796 for trunk/packages/sipb-xen-base/files/usr
- Timestamp:
- Jul 30, 2008, 10:13:02 PM (16 years ago)
- Location:
- trunk/packages/sipb-xen-base/files/usr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.