Update shebang to Python 3
[invirt/packages/invirt-base.git] / scripts / invirt-getconf
index 530efd6..2d5bff2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 """
 invirt-getconf loads an invirt configuration file (either the original YAML
@@ -13,12 +13,15 @@ the YAML configuration; e.g., they cannot contain dots.)
 Examples:
 
   invirt-getconf db.uri
-  invirt-getconf authn.0.type
+  invirt-getconf hosts.0.ip
 """
 
-from invirt import config
 from sys import argv, exit, stderr, stdout
 from optparse import OptionParser
+import yaml
+
+from invirt import config
+
 
 class invirt_exception(Exception): pass
 
@@ -73,7 +76,6 @@ def main(argv):
             if type(conf) not in (dict, list):
                 print conf
             else:
-                import yaml
                 yaml.dump(conf, stdout,
                           Dumper=yaml.CSafeDumper, default_flow_style=False)
     except invirt_exception, ex:
@@ -82,5 +84,3 @@ def main(argv):
 
 if __name__ == '__main__':
     exit(main(argv))
-
-# vim:et:sw=4:ts=4