diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-06-02 09:53:55 -0500 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-06-02 10:07:34 -0500 |
| commit | 6f2c1734e3d66e261f231711455821321c1fc254 (patch) | |
| tree | 269f19082215e0ccb37c361427062c9d4e91b646 /openstackclient/common/command.py | |
| parent | b349156059edb1c7ae8e4bdfbd5eb0826d7aa808 (diff) | |
| download | python-openstackclient-6f2c1734e3d66e261f231711455821321c1fc254.tar.gz | |
Fix --enable options on commands
The --enable option on commands is ignored when the arguments are parsed.
This is related to the --enable-beta-commands option. Renaming the option
to --os-beta-command fixes the problem.
There's no need to handle backwards compatibility for the option name
change because there hasn't been an OSC release yet with beta commands.
Change-Id: I0327ba8a2058858a83e9a42e231470ed733cc834
Closes-Bug: #1588384
Diffstat (limited to 'openstackclient/common/command.py')
| -rw-r--r-- | openstackclient/common/command.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openstackclient/common/command.py b/openstackclient/common/command.py index fee4559e..144a0db1 100644 --- a/openstackclient/common/command.py +++ b/openstackclient/common/command.py @@ -20,6 +20,9 @@ from cliff import lister from cliff import show import six +from openstackclient.common import exceptions +from openstackclient.i18n import _ + class CommandMeta(abc.ABCMeta): @@ -37,6 +40,13 @@ class Command(command.Command): self.log.debug('run(%s)', parsed_args) return super(Command, self).run(parsed_args) + def validate_os_beta_command_enabled(self): + if not self.app.options.os_beta_command: + msg = _('Caution: This is a beta command and subject to ' + 'change. Use global option --os-beta-command ' + 'to enable this command.') + raise exceptions.CommandError(msg) + class Lister(Command, lister.Lister): pass |
