diff options
author | Adrian Likins <alikins@redhat.com> | 2008-07-24 12:30:45 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2008-07-24 12:30:45 -0400 |
commit | 4017f687d13edacb5ce1fe446e7af50759df2e1f (patch) | |
tree | f4d4da235ee458ac6ac864f2bb268d1049a5ac44 /func/utils.py | |
parent | 4706b80a84f9e293349146058000595237babe62 (diff) | |
download | func-4017f687d13edacb5ce1fe446e7af50759df2e1f.tar.gz func-4017f687d13edacb5ce1fe446e7af50759df2e1f.tar.xz func-4017f687d13edacb5ce1fe446e7af50759df2e1f.zip |
gut most of func/utils.py
update code to use existing code from certmaster/utils.py
Diffstat (limited to 'func/utils.py')
-rwxr-xr-x | func/utils.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/func/utils.py b/func/utils.py index 9577bd9..0e4b4d5 100755 --- a/func/utils.py +++ b/func/utils.py @@ -18,49 +18,6 @@ import socket REMOTE_ERROR = "REMOTE_ERROR" -def trace_me(): - x = traceback.extract_stack() - bar = string.join(traceback.format_list(x)) - return bar - -def daemonize(pidfile=None): - """ - Daemonize this process with the UNIX double-fork trick. - Writes the new PID to the provided file name if not None. - """ - - print pidfile - pid = os.fork() - if pid > 0: - sys.exit(0) - os.setsid() - os.umask(0) - pid = os.fork() - - if pid > 0: - if pidfile is not None: - open(pidfile, "w").write(str(pid)) - sys.exit(0) - -def nice_exception(etype, evalue, etb): - etype = str(etype) - 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 ] - -def get_hostname(): - fqdn = socket.getfqdn() - host = socket.gethostname() - if fqdn.find(host) != -1: - return fqdn - else: - return host - def is_error(result): if type(result) != list: |