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 | |
---|---|
File size: 423 bytes |
Rev | Line | |
---|---|---|
[729] | 1 | #!/usr/bin/env python2.5 |
[726] | 2 | |
3 | from invirt.config import load | |
4 | from sys import argv, stderr | |
5 | ||
6 | def 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 | ||
15 | if __name__ == '__main__': | |
16 | main( argv ) | |
17 | ||
18 | # vim:et:sw=4:ts=4 |
Note: See TracBrowser
for help on using the repository browser.