summaryrefslogtreecommitdiffstats
path: root/certmaster/utils.py
diff options
context:
space:
mode:
authorAdrian Likins <alikins@redhat.com>2008-07-24 12:42:04 -0400
committerAdrian Likins <alikins@redhat.com>2008-07-24 12:42:04 -0400
commit621cc4e377e0bf0a48a7bbbf384a3f28d9933be9 (patch)
treee19ecb064b1d439c0c8f50af26d5d3ec5d23d165 /certmaster/utils.py
parent16ba4922c09e81f063ac10c65c70ac4fe9c0e0a7 (diff)
downloadcertmaster-621cc4e377e0bf0a48a7bbbf384a3f28d9933be9.tar.gz
certmaster-621cc4e377e0bf0a48a7bbbf384a3f28d9933be9.tar.xz
certmaster-621cc4e377e0bf0a48a7bbbf384a3f28d9933be9.zip
merge with the code from func
remove a spurious debug line
Diffstat (limited to 'certmaster/utils.py')
-rwxr-xr-xcertmaster/utils.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/certmaster/utils.py b/certmaster/utils.py
index 588e986..61721ac 100755
--- a/certmaster/utils.py
+++ b/certmaster/utils.py
@@ -44,7 +44,7 @@ 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)
@@ -57,12 +57,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 ]