Self NACK. I should not post patches when tired, sorry. Minor fix is
attached.
On 05/26/2016 07:21 PM, Stanislav Laznicka wrote:
Hello,
Please, see the attached patch. Fixes
https://fedorahosted.org/freeipa/ticket/5898
Standa
From b42146384771d95761cbeaab516f559ee87b66cc Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Thu, 26 May 2016 15:24:15 +0200
Subject: [PATCH] Fixes CA always being presented as running
Even after manually stopping the pki-tomcatd service instance the
service the is_running() method would still return True.
https://fedorahosted.org/freeipa/ticket/5898
---
ipaplatform/redhat/services.py | 18 ++++++++++++++++++
ipaserver/install/service.py | 4 ++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/ipaplatform/redhat/services.py b/ipaplatform/redhat/services.py
index 92dae452a31a0b3680e9c407eccb120881cc9e25..6f8ac2cb41c8b716d8fa13869565d9dc047d2cc4 100644
--- a/ipaplatform/redhat/services.py
+++ b/ipaplatform/redhat/services.py
@@ -222,6 +222,24 @@ class RedHatCAService(RedHatService):
if wait:
self.wait_until_running()
+ def is_running(self, instance_name=""):
+ if instance_name:
+ return super(RedHatCAService, self).is_running(instance_name)
+ while True:
+ try:
+ status = dogtag.ca_status()
+ except Exception as e:
+ root_logger.debug(
+ 'Failed to check CA status: {err}'.format(err=e)
+ )
+ return False
+ if status == 'running':
+ return True
+ elif status == 'starting':
+ time.sleep(1)
+ else:
+ return False
+
# Function that constructs proper Red Hat OS family-specific server classes for
# services of specified name
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index 40767acd57d5e1fa8126144ca64f6951848ce214..e1361c2fb339c73dd36028257ed862d02d9411e3 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -346,8 +346,8 @@ class Service(object):
def restart(self, instance_name="", capture_output=True, wait=True):
self.service.restart(instance_name, capture_output=capture_output, wait=wait)
- def is_running(self):
- return self.service.is_running()
+ def is_running(self, instance_name=""):
+ return self.service.is_running(instance_name)
def install(self):
self.service.install()
--
2.5.5
--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code