diff options
| author | Brant Knudson <bknudson@us.ibm.com> | 2015-03-18 14:57:50 -0500 |
|---|---|---|
| committer | Brant Knudson <bknudson@us.ibm.com> | 2015-03-18 20:06:09 -0500 |
| commit | 29c84cdf8b1f5982bdb90149ff66476d67e3a4ae (patch) | |
| tree | 345763f7ca92532e8ff8d65bde7ec2c2ce77859a /keystoneclient/shell.py | |
| parent | bde71a25f11a0ad067df6c648c3b550254c825d5 (diff) | |
| download | python-keystoneclient-29c84cdf8b1f5982bdb90149ff66476d67e3a4ae.tar.gz | |
Deprecate keystone CLI
The keystone CLI is now deprecated. Every time you run it it's
going to print out an annoying message saying how deprecated it
is.
bp deprecate-cli
Change-Id: Ife7ad2025f515dc716efe2b2dd275663c21402da
Diffstat (limited to 'keystoneclient/shell.py')
| -rw-r--r-- | keystoneclient/shell.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index 854cafe..1221e57 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -14,13 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Pending deprecation: Command-line interface to the OpenStack Identity API. - -This CLI is pending deprecation in favor of python-openstackclient. For a -Python library, continue using python-keystoneclient. - -""" +"""Command-line interface to the OpenStack Identity API.""" from __future__ import print_function @@ -29,6 +23,7 @@ import getpass import logging import os import sys +import warnings from oslo_utils import encodeutils import six @@ -60,6 +55,16 @@ def env(*vars, **kwargs): class OpenStackIdentityShell(object): def __init__(self, parser_class=argparse.ArgumentParser): + + # Since Python 2.7, DeprecationWarning is ignored by default, enable + # it so that the deprecation message is displayed. + warnings.simplefilter('once', category=DeprecationWarning) + warnings.warn( + 'The keystone CLI is deprecated in favor of ' + 'python-openstackclient. For a Python library, continue using ' + 'python-keystoneclient.', DeprecationWarning) + # And back to normal! + warnings.resetwarnings() self.parser_class = parser_class def get_base_parser(self): |
