Hi,

the attached patch fixes <https://fedorahosted.org/freeipa/ticket/4835>.

Honza

--
Jan Cholasta
>From 09155e3546adbeededbd025dea631c2a5ac39cc6 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Tue, 13 Jan 2015 10:59:08 +0000
Subject: [PATCH] Do not crash on unknown services in
 installutils.stopped_service

https://fedorahosted.org/freeipa/ticket/4835
---
 ipaserver/install/installutils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index 64578f7..6955edf 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -867,19 +867,19 @@ def stopped_service(service, instance_name=""):
                       log_instance_name)
 
     # Figure out if the service is running, if not, yield
-    if not services.knownservices[service].is_running(instance_name):
+    if not services.service(service).is_running(instance_name):
         root_logger.debug('Service %s%s is not running, continue.', service,
                           log_instance_name)
         yield
     else:
         # Stop the service, do the required stuff and start it again
         root_logger.debug('Stopping %s%s.', service, log_instance_name)
-        services.knownservices[service].stop(instance_name)
+        services.service(service).stop(instance_name)
         try:
             yield
         finally:
             root_logger.debug('Starting %s%s.', service, log_instance_name)
-            services.knownservices[service].start(instance_name)
+            services.service(service).start(instance_name)
 
 def check_entropy():
     '''
-- 
2.1.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to