diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-01-17 12:32:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-17 12:32:16 +0100 |
commit | abe838c4fcd20fb51d1de3dac495036a9e4159b0 (patch) | |
tree | 6e99e4847565fc57bc75fb775ab620536c948171 /roles/openshift_facts | |
parent | b01d19b5a37330c4b3fea5f1f54efd6ef0e207c0 (diff) | |
parent | 01046c33e0bdcaf44dbd9bfcdf84f1a9a335437c (diff) | |
download | openshift-abe838c4fcd20fb51d1de3dac495036a9e4159b0.tar.gz openshift-abe838c4fcd20fb51d1de3dac495036a9e4159b0.tar.bz2 openshift-abe838c4fcd20fb51d1de3dac495036a9e4159b0.tar.xz openshift-abe838c4fcd20fb51d1de3dac495036a9e4159b0.zip |
Merge pull request #2993 from rhcarvalho/success-preflight
Add RPM checks as a byo playbook
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 10e30f1c4..616b41c7b 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1246,10 +1246,10 @@ def build_api_server_args(facts): def is_service_running(service): """ Queries systemd through dbus to see if the service is running """ service_running = False - bus = SystemBus() - systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1') - manager = Interface(systemd, dbus_interface='org.freedesktop.systemd1.Manager') try: + bus = SystemBus() + systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1') + manager = Interface(systemd, dbus_interface='org.freedesktop.systemd1.Manager') service_unit = service if service.endswith('.service') else manager.GetUnit('{0}.service'.format(service)) service_proxy = bus.get_object('org.freedesktop.systemd1', str(service_unit)) service_properties = Interface(service_proxy, dbus_interface='org.freedesktop.DBus.Properties') @@ -1258,6 +1258,8 @@ def is_service_running(service): if service_load_state == 'loaded' and service_active_state == 'active': service_running = True except DBusException: + # TODO: do not swallow exception, as it may be hiding useful debugging + # information. pass return service_running |