From 1a90ceb3e02e50a54bc0267571e0f4554201b579 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 23 Apr 2009 16:33:20 +0000 Subject: More python 2to3 updates along with pylint/code cleanups Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5173 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Daemon.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib/Daemon.py') 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) -- cgit v1.2.3-1-g7c22