]> scripts.mit.edu Git - wizard.git/commitdiff
Fix absolute path from environment bug and debug-all-the-time bug.
authorEdward Z. Yang <ezyang@mit.edu>
Thu, 13 Aug 2009 02:27:49 +0000 (22:27 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Thu, 13 Aug 2009 02:27:49 +0000 (22:27 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
bin/wizard
wizard/command/__init__.py

index 3f2771d7e1d65e7a18a0843888f9f660eff7365c..411c31d6a5c41238881cf867dcf0cbce04ba06ff 100755 (executable)
@@ -33,10 +33,10 @@ See '%prog help COMMAND' for more information on a specific command."""
     rest_argv = args[1:]
     baton = command.OptionBaton()
     baton.add("--versions-path", dest="versions_path",
-        default=os.getenv("WIZARD_VERSIONS_PATH") or "/afs/athena.mit.edu/contrib/scripts/sec-tools/store/versions",
+        default=getenvpath("WIZARD_VERSIONS_PATH") or "/afs/athena.mit.edu/contrib/scripts/sec-tools/store/versions",
         help="Location of parallel-find output directory, or a file containing a newline separated list of 'all autoinstalls' (for development work).  Environment variable is WIZARD_VERSIONS_PATH.")
     baton.add("--srv-path", dest="srv_path",
-        default=os.getenv("WIZARD_SRV_PATH") or "/afs/athena.mit.edu/contrib/scripts/git/autoinstalls",
+        default=getenvpath("WIZARD_SRV_PATH") or "/afs/athena.mit.edu/contrib/scripts/git/autoinstalls",
         help="Location of autoinstall Git repositories, such that $REPO_PATH/$APP.git is a repository (for development work).  Environment variable is WIZARD_SRV_PATH.")
     try:
         command_name = args[0]
@@ -63,6 +63,12 @@ def get_command(name):
     __import__("wizard.command." + name)
     return getattr(wizard.command, name)
 
+def getenvpath(name):
+    val = os.getenv(name)
+    if val:
+        val = os.path.abspath(val)
+    return val
+
 if __name__ == "__main__":
     main()
 
index db4ff2731219690f8cbcbf2ef21f1abbd6f56953..74b6e5eb41e9f249dc808bcc3ed69fadb87cb680 100644 (file)
@@ -133,9 +133,9 @@ class WizardOptionParser(optparse.OptionParser):
         group.add_option("-v", "--verbose", dest="verbose", action="store_true",
                 default=boolish(os.getenv("WIZARD_VERBOSE")), help="Turns on verbose output.  Environment variable is WIZARD_VERBOSE")
         group.add_option("--debug", dest="debug", action="store_true",
-                default=boolish("WIZARD_DEBUG"), help="Turns on debugging output.  Environment variable is WIZARD_DEBUG")
+                default=boolish(os.getenv("WIZARD_DEBUG")), help="Turns on debugging output.  Environment variable is WIZARD_DEBUG")
         group.add_option("-q", "--quiet", dest="quiet", action="store_true",
-                default=False, help="Turns off output to stdout")
+                default=boolish(os.getenv("WIZARD_QUIET")), help="Turns off output to stdout. Environment variable is WIZARD_QUIET")
         group.add_option("--log-file", dest="log_file", metavar="FILE",
                 default=None, help="Logs verbose output to file")
         group.add_option("--log-file-chmod", dest="log_file_chmod", metavar="CHMOD",