Ignore:
Timestamp:
Aug 2, 2008, 8:28:18 PM (16 years ago)
Author:
y_z
Message:
  • use invirt.config to get hostnames
  • refactoring: extracted bcast() function into invirt.remote package
  • fixed os.rename import bug
  • using correct default paths in invirt-getconf
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  
    1717"""
    1818
    19 from invirt.config import load
     19from invirt.config import default_src_path, default_cache_path, load
    2020from sys import argv, exit, stderr, stdout
    2121from optparse import OptionParser
     
    2828                description = __doc__.strip().split('\n\n')[0])
    2929        parser.add_option('-s', '--src',
    30                 default = '/etc/invirt/master.yaml',
     30                default = default_src_path,
    3131                help = 'the source YAML configuration file to read from')
    3232        parser.add_option('-c', '--cache',
    33                 default = '/var/lib/invirt/invirt.json',
     33                default = default_cache_path,
    3434                help = 'path to the JSON cache')
    3535        parser.add_option('-r', '--refresh',
     
    8181            else:
    8282                import yaml
     83                try:    dumper = yaml.CSafeDumper
     84                except: dumper = yaml.SafeDumper
    8385                yaml.dump(conf, stdout,
    84                           Dumper=yaml.CSafeDumper, default_flow_style=False)
     86                          Dumper = dumper, default_flow_style = False)
    8587    except invirt_exception, ex:
    8688        print >> stderr, ex
  • trunk/packages/sipb-xen-base/files/usr/share/python-support/sipb-xen-base/invirt/config.py

    r807 r816  
    11import json
    22from invirt.common import *
     3from os import rename
    34from os.path import getmtime
    45
     
    7576                        lambda f: f.write(json.write(ns.cfg)))
    7677                except: pass # silent failure
    77                 else: os.rename(cache_path + '.tmp', cache_path)
     78                else: rename(cache_path + '.tmp', cache_path)
    7879        except IOError:
    7980            ns.cfg = with_closing(file(src_path)) (
Note: See TracChangeset for help on using the changeset viewer.