--- /dev/null
+#!/usr/bin/env python
+
+from invirt.config import load
+from sys import argv, stderr
+
+def main( argv ):
+ try: command, key = argv
+ except: print >> stderr, 'invirt-getconf KEY'
+ conf = load()
+ for component in key.split('.')[:-1]:
+ if component.isdigit(): component = int( component )
+ conf = conf[ component ]
+ print conf[key]
+
+if __name__ == '__main__':
+ main( argv )
+
+# vim:et:sw=4:ts=4
--- /dev/null
+from __future__ import with_statement
+import yaml
+
+default_path = '/etc/invirt/master.yaml'
+
+def load( path = default_path ):
+ with file( path ) as f:
+ return yaml.load( f, yaml.CSafeLoader )
+
+# vim:et:sw=4:ts=4