diff --git a/roles/fedmsg/base/templates/base.py.j2 b/roles/fedmsg/base/templates/base.py.j2 index ab7bd9b265..2d1e69b768 100644 --- a/roles/fedmsg/base/templates/base.py.j2 +++ b/roles/fedmsg/base/templates/base.py.j2 @@ -55,7 +55,7 @@ try: config['moksha.monitoring.socket'] = \ 'ipc:///var/run/fedmsg/monitoring-%s.socket' % proc.name -except OSError: +except (OSError, ImportError): # We run into issues when trying to import psutil from mod_wsgi on rhel7 # but this feature is of no concern in that context, so just fail quietly. # https://github.com/jmflinuxtx/kerneltest-harness/pull/17#issuecomment-48007837 diff --git a/roles/fedmsg/base/templates/logging.py.j2 b/roles/fedmsg/base/templates/logging.py.j2 index 5cc65aa6b2..027d032afd 100644 --- a/roles/fedmsg/base/templates/logging.py.j2 +++ b/roles/fedmsg/base/templates/logging.py.j2 @@ -10,7 +10,7 @@ import traceback psutil = None try: import psutil -except OSError: +except (OSError, ImportError): # We run into issues when trying to import psutil from inside mod_wsgi on # rhel7. If we hit that here, then just fail quietly. # https://github.com/jmflinuxtx/kerneltest-harness/pull/17#issuecomment-48007837