summaryrefslogtreecommitdiffstats
path: root/ipaplatform/redhat
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-05-26 15:24:15 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-15 18:11:28 +0200
commitfb4e19713d509a0a14acb7eee37f5fee7a9fb375 (patch)
tree90b76b4cca29ebc257de9aa6fcb7d14f3317d40f /ipaplatform/redhat
parent01795fca831ca5ce59a56755d261cb3100d6c3d4 (diff)
downloadfreeipa-fb4e19713d509a0a14acb7eee37f5fee7a9fb375.tar.gz
freeipa-fb4e19713d509a0a14acb7eee37f5fee7a9fb375.tar.xz
freeipa-fb4e19713d509a0a14acb7eee37f5fee7a9fb375.zip
Fixes CA always being presented as running
Even after manually stopping the pki-tomcatd service instance the service's is_running() method would still return True. https://fedorahosted.org/freeipa/ticket/5898 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaplatform/redhat')
-rw-r--r--ipaplatform/redhat/services.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ipaplatform/redhat/services.py b/ipaplatform/redhat/services.py
index 92dae452a..849737059 100644
--- a/ipaplatform/redhat/services.py
+++ b/ipaplatform/redhat/services.py
@@ -222,6 +222,23 @@ class RedHatCAService(RedHatService):
if wait:
self.wait_until_running()
+ def is_running(self, instance_name="", wait=True):
+ if instance_name:
+ return super(RedHatCAService, self).is_running(instance_name)
+ try:
+ status = dogtag.ca_status()
+ if status == 'running':
+ return True
+ elif status == 'starting' and wait:
+ # Exception is raised if status is 'starting' even after wait
+ self.wait_until_running()
+ return True
+ except Exception as e:
+ root_logger.debug(
+ 'Failed to check CA status: {err}'.format(err=e)
+ )
+ return False
+
# Function that constructs proper Red Hat OS family-specific server classes for
# services of specified name