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/network/v2 | |
| 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/network/v2')
| -rw-r--r-- | openstackclient/network/v2/network_segment.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/openstackclient/network/v2/network_segment.py b/openstackclient/network/v2/network_segment.py index d8a91fd2..818ffc02 100644 --- a/openstackclient/network/v2/network_segment.py +++ b/openstackclient/network/v2/network_segment.py @@ -16,7 +16,6 @@ # TODO(rtheis): Add description and name properties when support is available. from openstackclient.common import command -from openstackclient.common import exceptions from openstackclient.common import utils from openstackclient.i18n import _ @@ -25,7 +24,7 @@ class ListNetworkSegment(command.Lister): """List network segments (Caution: This is a beta command and subject to change. - Use global option --enable-beta-commands to enable + Use global option --os-beta-command to enable this command) """ @@ -46,11 +45,7 @@ class ListNetworkSegment(command.Lister): return parser def take_action(self, parsed_args): - if not self.app.options.enable_beta_commands: - msg = _('Caution: This is a beta command and subject to ' - 'change. Use global option --enable-beta-commands ' - 'to enable this command.') - raise exceptions.CommandError(msg) + self.validate_os_beta_command_enabled() network_client = self.app.client_manager.network @@ -94,7 +89,7 @@ class ShowNetworkSegment(command.ShowOne): """Display network segment details (Caution: This is a beta command and subject to change. - Use global option --enable-beta-commands to enable + Use global option --os-beta-command to enable this command) """ @@ -108,11 +103,7 @@ class ShowNetworkSegment(command.ShowOne): return parser def take_action(self, parsed_args): - if not self.app.options.enable_beta_commands: - msg = _('Caution: This is a beta command and subject to ' - 'change. Use global option --enable-beta-commands ' - 'to enable this command.') - raise exceptions.CommandError(msg) + self.validate_os_beta_command_enabled() client = self.app.client_manager.network obj = client.find_segment( |
