From 8978991d8e2942de22e6a98cfc049d0c51f19411 Mon Sep 17 00:00:00 2001 From: Amol Kahat Date: Tue, 14 Jun 2016 16:36:40 +0530 Subject: Fixed pki-server instance-start command. Fixed pki-server instance-stop command. https://bugzilla.redhat.com/show_bug.cgi?id=1341953 --- base/server/python/pki/server/cli/instance.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'base/server/python') diff --git a/base/server/python/pki/server/cli/instance.py b/base/server/python/pki/server/cli/instance.py index d395cc8b6..6e336e111 100644 --- a/base/server/python/pki/server/cli/instance.py +++ b/base/server/python/pki/server/cli/instance.py @@ -331,6 +331,15 @@ class InstanceStartCLI(pki.cli.CLI): instance_name = args[0] instance = pki.server.PKIInstance(instance_name) + + if not instance.is_valid(): + self.print_message('%s instance not found' % instance_name) + sys.exit(1) + + if instance.is_active(): + self.print_message('%s instance already started' % instance_name) + return + instance.load() instance.start() @@ -381,6 +390,15 @@ class InstanceStopCLI(pki.cli.CLI): instance_name = args[0] instance = pki.server.PKIInstance(instance_name) + + if not instance.is_valid(): + self.print_message('%s instance not found' % instance_name) + sys.exit(1) + + if not instance.is_active(): + self.print_message('%s instance already stopped' % instance_name) + return + instance.load() instance.stop() -- cgit