summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-06-04 13:05:30 +0000
committerGerrit Code Review <review@openstack.org>2016-06-04 13:05:30 +0000
commit55a7ba890d9c3a53b7728efe41053b79ba1e60d3 (patch)
tree2c093d1e78fee714a3cf3e57f9ccbf91ad3cec04 /openstackclient/common
parent416792f079e7d15d8747736ee792d1f5c30aa389 (diff)
parent6f2c1734e3d66e261f231711455821321c1fc254 (diff)
downloadpython-openstackclient-55a7ba890d9c3a53b7728efe41053b79ba1e60d3.tar.gz
Merge "Fix --enable options on commands"
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/command.py10
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