diff options
| author | Amol Kahat <akahat@redhat.com> | 2016-06-09 16:34:22 +0530 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2016-06-13 16:21:24 +0200 |
| commit | 5f1bd9ce85dbe13ce8b40e6ffcf6812d6e54a12d (patch) | |
| tree | 7801ab54a28f8f04de27ef9f72310ce6d8aba80f /base/server/python | |
| parent | 5afd373896672894a361ad7f96f6d71e2d2d52a4 (diff) | |
| download | pki-5f1bd9ce85dbe13ce8b40e6ffcf6812d6e54a12d.tar.gz pki-5f1bd9ce85dbe13ce8b40e6ffcf6812d6e54a12d.tar.xz pki-5f1bd9ce85dbe13ce8b40e6ffcf6812d6e54a12d.zip | |
Fixed --help option for instance-show, instance-start, instance-stop, instance-migrate, instance-nuxwdog-enable, instance-nuxwdog-disable.
https://bugzilla.redhat.com/show_bug.cgi?id=1339263
Diffstat (limited to 'base/server/python')
| -rw-r--r-- | base/server/python/pki/server/cli/instance.py | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/base/server/python/pki/server/cli/instance.py b/base/server/python/pki/server/cli/instance.py index 7520b32b8..d395cc8b6 100644 --- a/base/server/python/pki/server/cli/instance.py +++ b/base/server/python/pki/server/cli/instance.py @@ -261,13 +261,6 @@ class InstanceShowCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] - for o, _ in opts: if o in ('-v', '--verbose'): self.set_verbose(True) @@ -281,6 +274,13 @@ class InstanceShowCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + instance = pki.server.PKIInstance(instance_name) instance.load() @@ -310,13 +310,6 @@ class InstanceStartCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] - for o, _ in opts: if o in ('-v', '--verbose'): self.set_verbose(True) @@ -330,6 +323,13 @@ class InstanceStartCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + instance = pki.server.PKIInstance(instance_name) instance.load() instance.start() @@ -360,13 +360,6 @@ class InstanceStopCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] - for o, _ in opts: if o in ('-v', '--verbose'): self.set_verbose(True) @@ -380,6 +373,13 @@ class InstanceStopCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + instance = pki.server.PKIInstance(instance_name) instance.load() instance.stop() @@ -412,12 +412,6 @@ class InstanceMigrateCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] tomcat_version = None for o, a in opts: @@ -440,6 +434,13 @@ class InstanceMigrateCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + if not tomcat_version: tomcat_version = pki.server.Tomcat.get_major_version() @@ -484,13 +485,6 @@ class InstanceNuxwdogEnableCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] - for o, _ in opts: if o in ('-v', '--verbose'): self.set_verbose(True) @@ -502,6 +496,13 @@ class InstanceNuxwdogEnableCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + module = self.get_top_module().find_module('nuxwdog-enable') module = pki.server.cli.nuxwdog.NuxwdogEnableCLI() module.set_verbose(self.verbose) @@ -539,13 +540,6 @@ class InstanceNuxwdogDisableCLI(pki.cli.CLI): self.print_help() sys.exit(1) - if len(args) != 1: - print('ERROR: missing instance ID') - self.print_help() - sys.exit(1) - - instance_name = args[0] - for o, _ in opts: if o in ('-v', '--verbose'): self.set_verbose(True) @@ -557,6 +551,13 @@ class InstanceNuxwdogDisableCLI(pki.cli.CLI): self.print_help() sys.exit(1) + if len(args) != 1: + print('ERROR: missing instance ID') + self.print_help() + sys.exit(1) + + instance_name = args[0] + module = self.get_top_module().find_module('nuxwdog-disable') module.set_verbose(self.verbose) |
