diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-04-23 16:33:20 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-04-23 16:33:20 +0000 |
commit | 1a90ceb3e02e50a54bc0267571e0f4554201b579 (patch) | |
tree | edd3944fe64408295901fc8b7c340d0c659fc627 /src/lib/Daemon.py | |
parent | 4869aaf3a4cbf1034ff3c457c546aa82999fda65 (diff) | |
download | bcfg2-1a90ceb3e02e50a54bc0267571e0f4554201b579.tar.gz bcfg2-1a90ceb3e02e50a54bc0267571e0f4554201b579.tar.bz2 bcfg2-1a90ceb3e02e50a54bc0267571e0f4554201b579.zip |
More python 2to3 updates along with pylint/code cleanups
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5173 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Daemon.py')
-rw-r--r-- | src/lib/Daemon.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/Daemon.py b/src/lib/Daemon.py index bdce2c179..8798c7461 100644 --- a/src/lib/Daemon.py +++ b/src/lib/Daemon.py @@ -1,7 +1,8 @@ '''Bcfg2 daemon support''' __revision__ = '$Revision$' -import os, sys +import os +import sys def daemonize(filename): '''Do the double fork/setsession dance''' @@ -15,9 +16,9 @@ def daemonize(filename): # If we got this far without exceptions, there is another instance # running. Exit gracefully. - print "PID File (%s) exists and listed PID (%d) is active." % \ - (filename, oldpid) - raise SystemExit, 1 + print("PID File (%s) exists and listed PID (%d) is active." % \ + (filename, oldpid)) + raise SystemExit(1) except OSError: pidfile.close() except (IOError, ValueError): @@ -35,7 +36,7 @@ def daemonize(filename): pidfile.write("%i" % pid) pidfile.close() except: - print "Failed to write pid file %s" % filename + print("Failed to write pid file %s" % filename) os._exit(0) os.chdir("/") os.umask(0) |