diff options
author | Matt Kemp <matt@mattikus.com> | 2014-10-02 18:15:59 +0000 |
---|---|---|
committer | Matt Kemp <matt@mattikus.com> | 2014-10-02 18:15:59 +0000 |
commit | 5038a6278a1700671141ec58ea4a3cc5ce799e3b (patch) | |
tree | a3f1954aafe768e2dc565ce9bfbf06109409f83e /src | |
parent | 5d7e50dd4f55026390f9a545d0893c3ca51c7a96 (diff) | |
download | bcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.tar.gz bcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.tar.bz2 bcfg2-5038a6278a1700671141ec58ea4a3cc5ce799e3b.zip |
Catch possible typeerror resulting from None being returned when reading the pid.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Bcfg2/Reporting/Collector.py | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/BuiltinCore.py | 2 |
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] |