Merge branch 'master' of ssh://alikins@git.fedoraproject.org/git/hosted/certmaster
authorAdrian Likins <alikins@redhat.com>
Fri, 5 Sep 2008 18:15:52 +0000 (14:15 -0400)
committerAdrian Likins <alikins@redhat.com>
Fri, 5 Sep 2008 18:15:52 +0000 (14:15 -0400)
.gitignore [new file with mode: 0644]
AUTHORS
certmaster/utils.py

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..35a6b22
--- /dev/null
@@ -0,0 +1,5 @@
+*.py~
+*.pyc
+*~
+\#*\#
+build/
diff --git a/AUTHORS b/AUTHORS
index 2b25c38..5ab8e48 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,6 +10,7 @@ Additional patches and contributions by ...
 
    Tanabe Ken-ichi <nabeken@tknetworks.org>
    Steve Salesvan <ssalevan@redhat.com>
+   Jonathan Barber <j.barber@dundee.ac.uk>
    ... 
    
    [ send in patches to get your name here ]
index 588e986..22b0afb 100755 (executable)
@@ -44,10 +44,14 @@ def daemonize(pidfile=None):
     Writes the new PID to the provided file name if not None.
     """
 
-    print pidfile
+#    print pidfile
     pid = os.fork()
     if pid > 0:
         sys.exit(0)
+    os.close(0)
+    os.close(1)
+    os.close(2)
+    os.cwd("/")
     os.setsid()
     os.umask(0)
     pid = os.fork()
@@ -57,12 +61,15 @@ def daemonize(pidfile=None):
             open(pidfile, "w").write(str(pid))
         sys.exit(0)
 
+
 def nice_exception(etype, evalue, etb):
-    # FIXME: I believe we can remove this function
     etype = str(etype)
-    lefti = etype.index("'") + 1
-    righti = etype.rindex("'")
-    nicetype = etype[lefti:righti]
+    try:
+        lefti = etype.index("'") + 1
+        righti = etype.rindex("'")
+        nicetype = etype[lefti:righti]
+    except:
+        nicetype = etype
     nicestack = string.join(traceback.format_list(traceback.extract_tb(etb)))
     return [ REMOTE_ERROR, nicetype, str(evalue), nicestack ]