summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Kemp <matt@mattikus.com>2014-10-02 18:15:59 +0000
committerMatt Kemp <matt@mattikus.com>2014-10-02 18:15:59 +0000
commit5038a6278a1700671141ec58ea4a3cc5ce799e3b (patch)
treea3f1954aafe768e2dc565ce9bfbf06109409f83e
parent5d7e50dd4f55026390f9a545d0893c3ca51c7a96 (diff)
downloadbcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.tar.gz
bcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.tar.bz2
bcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.zip
Catch possible typeerror resulting from None being returned when reading the pid.
-rw-r--r--src/lib/Bcfg2/Reporting/Collector.py2
-rw-r--r--src/lib/Bcfg2/Server/BuiltinCore.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Reporting/Collector.py b/src/lib/Bcfg2/Reporting/Collector.py
index 336604daa..2ff09d483 100644
--- a/src/lib/Bcfg2/Reporting/Collector.py
+++ b/src/lib/Bcfg2/Reporting/Collector.py
@@ -131,7 +131,7 @@ class ReportingCollector(object):
except LockTimeout:
try: # attempt to break the lock
os.kill(self.context.pidfile.read_pid(), 0)
- except OSError: # No process with locked PID
+ except (OSError, TypeError): # No process with locked PID
self.context.pidfile.break_lock()
else:
self.logger.error("Failed to daemonize: "
diff --git a/src/lib/Bcfg2/Server/BuiltinCore.py b/src/lib/Bcfg2/Server/BuiltinCore.py
index ed959f78d..29beb35d5 100644
--- a/src/lib/Bcfg2/Server/BuiltinCore.py
+++ b/src/lib/Bcfg2/Server/BuiltinCore.py
@@ -94,7 +94,7 @@ class Core(BaseCore):
except LockTimeout:
try: # attempt to break the lock
os.kill(self.context.pidfile.read_pid(), 0)
- except OSError: # No process with locked PID
+ except (OSError, TypeError): # No process with locked PID
self.context.pidfile.break_lock()
else:
err = sys.exc_info()[1]