diff options
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index d797eb4d3..0d85dba4b 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -22,9 +22,14 @@ from distutils.util import strtobool from distutils.version import LooseVersion import struct import socket -from dbus import SystemBus, Interface -from dbus.exceptions import DBusException +HAVE_DBUS=False +try: + from dbus import SystemBus, Interface + from dbus.exceptions import DBusException + HAVE_DBUS=True +except ImportError: + pass DOCUMENTATION = ''' --- @@ -2277,6 +2282,9 @@ def main(): add_file_common_args=True, ) + if not HAVE_DBUS: + module.fail_json(msg="This module requires dbus python bindings") + module.params['gather_subset'] = ['hardware', 'network', 'virtual', 'facter'] module.params['gather_timeout'] = 10 module.params['filter'] = '*' |