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

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

switched to python2.5

File size: 423 bytes
RevLine 
[729]1#!/usr/bin/env python2.5
[726]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.