]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/util.py
Log reponse code and headers.
[wizard.git] / wizard / util.py
index 9039f6aafba64f95b4f1111ffdb8c5d41b576ff9..47588e5482b39cd21e92dffea34ecaeddec4f0d7 100644 (file)
@@ -252,6 +252,8 @@ def set_operator_env():
     if op is None:
         return
     info = user.pwnam(op)
+    if not info.realname:
+        return
     os.putenv("GIT_COMMITTER_NAME", info.realname)
     os.putenv("GIT_COMMITTER_EMAIL", info.email)
 
@@ -264,6 +266,8 @@ def set_author_env():
     info = user.passwd()
     if info is None:
         return
+    if not info.realname:
+        return
     os.putenv("GIT_AUTHOR_NAME", "%s" % info.realname)
     os.putenv("GIT_AUTHOR_EMAIL", "%s" % info.email)
 
@@ -325,6 +329,8 @@ def fetch(host, path, subpath, post=None):
             logging.info("GET request to http://%s%s", host, fullpath)
             h.request("GET", fullpath)
         r = h.getresponse()
+        logging.debug("Response code: %d", r.status)
+        logging.debug("Response headers: %s", r.msg)
         data = r.read()
         h.close()
         return data