Changeset 816 for trunk/packages/sipb-xen-base
- Timestamp:
- Aug 2, 2008, 8:28:18 PM (16 years ago)
- Location:
- trunk/packages/sipb-xen-base/files/usr
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-base/files/usr/sbin/invirt-getconf
r802 r816 17 17 """ 18 18 19 from invirt.config import load19 from invirt.config import default_src_path, default_cache_path, load 20 20 from sys import argv, exit, stderr, stdout 21 21 from optparse import OptionParser … … 28 28 description = __doc__.strip().split('\n\n')[0]) 29 29 parser.add_option('-s', '--src', 30 default = '/etc/invirt/master.yaml',30 default = default_src_path, 31 31 help = 'the source YAML configuration file to read from') 32 32 parser.add_option('-c', '--cache', 33 default = '/var/lib/invirt/invirt.json',33 default = default_cache_path, 34 34 help = 'path to the JSON cache') 35 35 parser.add_option('-r', '--refresh', … … 81 81 else: 82 82 import yaml 83 try: dumper = yaml.CSafeDumper 84 except: dumper = yaml.SafeDumper 83 85 yaml.dump(conf, stdout, 84 Dumper =yaml.CSafeDumper, default_flow_style=False)86 Dumper = dumper, default_flow_style = False) 85 87 except invirt_exception, ex: 86 88 print >> stderr, ex -
trunk/packages/sipb-xen-base/files/usr/share/python-support/sipb-xen-base/invirt/config.py
r807 r816 1 1 import json 2 2 from invirt.common import * 3 from os import rename 3 4 from os.path import getmtime 4 5 … … 75 76 lambda f: f.write(json.write(ns.cfg))) 76 77 except: pass # silent failure 77 else: os.rename(cache_path + '.tmp', cache_path)78 else: rename(cache_path + '.tmp', cache_path) 78 79 except IOError: 79 80 ns.cfg = with_closing(file(src_path)) (
Note: See TracChangeset
for help on using the changeset viewer.