Merge "Deprecate keystone CLI"

This commit is contained in:
Jenkins
2015-03-20 01:34:39 +00:00
committed by Gerrit Code Review

View File

@@ -14,13 +14,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
""" """Command-line interface to the OpenStack Identity API."""
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.
"""
from __future__ import print_function from __future__ import print_function
@@ -29,6 +23,7 @@ import getpass
import logging import logging
import os import os
import sys import sys
import warnings
from oslo_utils import encodeutils from oslo_utils import encodeutils
import six import six
@@ -60,6 +55,16 @@ def env(*vars, **kwargs):
class OpenStackIdentityShell(object): class OpenStackIdentityShell(object):
def __init__(self, parser_class=argparse.ArgumentParser): 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 self.parser_class = parser_class
def get_base_parser(self): def get_base_parser(self):