source: trunk/packages/sipb-xen-base/files/usr/sbin/invirt-getconf @ 726

Last change on this file since 726 was 726, checked in by y_z, 16 years ago

started adding simple configuration-loading module and getconfig frontend; checkpoint for moving dev to home machine which actually has yaml, etc.

File size: 420 bytes
RevLine 
[726]1#!/usr/bin/env python
2
3from invirt.config import load
4from sys import argv, stderr
5
6def main( argv ):
7    try: command, key = argv
8    except: print >> stderr, 'invirt-getconf KEY'
9    conf = load()
10    for component in key.split('.')[:-1]:
11        if component.isdigit(): component = int( component )
12        conf = conf[ component ]
13    print conf[key]
14
15if __name__ == '__main__':
16    main( argv )
17
18# vim:et:sw=4:ts=4
Note: See TracBrowser for help on using the repository browser.