diff options
author | Jan Cholasta <jcholast@redhat.com> | 2015-01-13 10:59:08 +0000 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-01-13 17:54:12 +0000 |
commit | 5bf1c9a6f7d734c296c8eb987cfc4f7e2a345130 (patch) | |
tree | 7be3bd85720ef393d42066cda5a9506e6ca72ce9 | |
parent | a63df8f3091992e227fe4654977bb91386ce0491 (diff) | |
download | freeipa-5bf1c9a6f7d734c296c8eb987cfc4f7e2a345130.tar.gz freeipa-5bf1c9a6f7d734c296c8eb987cfc4f7e2a345130.tar.xz freeipa-5bf1c9a6f7d734c296c8eb987cfc4f7e2a345130.zip |
Do not crash on unknown services in installutils.stopped_service
https://fedorahosted.org/freeipa/ticket/4835
Reviewed-By: David Kupka <dkupka@redhat.com>
-rw-r--r-- | ipaserver/install/installutils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index c2b7ae512..1a4c170f4 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -931,20 +931,22 @@ def stopped_service(service, instance_name=""): 'the next set of commands is being executed.', service, log_instance_name) + service_obj = services.service(service) + # Figure out if the service is running, if not, yield - if not services.knownservices[service].is_running(instance_name): + if not service_obj.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) + service_obj.stop(instance_name) try: yield finally: root_logger.debug('Starting %s%s.', service, log_instance_name) - services.knownservices[service].start(instance_name) + service_obj.start(instance_name) def check_entropy(): |