diff options
author | Steve Martinelli <stevemar@ca.ibm.com> | 2015-12-15 18:00:16 -0500 |
---|---|---|
committer | Steve Martinelli <stevemar@ca.ibm.com> | 2016-03-10 03:51:01 +0000 |
commit | ef13bd8cf6c6e46f4ce04fa3a21552913417b586 (patch) | |
tree | 80119db045b13244f9d13b87dc73913216d20c35 /keystoneclient/utils.py | |
parent | 9b028b5cdd1b0ef7260fa530a5a5925d78f81646 (diff) | |
download | python-keystoneclient-ef13bd8cf6c6e46f4ce04fa3a21552913417b586.tar.gz |
remove CLI from keystoneclient
the CLI has been deprecated for a long time, and many docs and
install guides recommend using OSC instead of `keystone`.
- removes CLI
- removes man page from docs
- removes CLI tests
- removes `bootstrap` from contrib
- removes entrypoint from setup.cfg
implements bp: remove-cli
Change-Id: Icbe15814bc4faf33f513f9654440068795eae807
Diffstat (limited to 'keystoneclient/utils.py')
-rw-r--r-- | keystoneclient/utils.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py index 7f36d85..7d3fcef 100644 --- a/keystoneclient/utils.py +++ b/keystoneclient/utils.py @@ -15,12 +15,10 @@ import hashlib import logging import sys -from oslo_utils import encodeutils from oslo_utils import timeutils # NOTE(stevemar): do not remove positional. We need this to stay for a while # since versions of auth_token require it here. from positional import positional # noqa -import prettytable import six from keystoneclient import exceptions @@ -29,73 +27,6 @@ from keystoneclient import exceptions logger = logging.getLogger(__name__) -# Decorator for cli-args -def arg(*args, **kwargs): - def _decorator(func): - # Because of the semantics of decorator composition if we just append - # to the options list positional options will appear to be backwards. - func.__dict__.setdefault('arguments', []).insert(0, (args, kwargs)) - return func - return _decorator - - -def pretty_choice_list(l): - return ', '.join("'%s'" % i for i in l) - - -def print_list(objs, fields, formatters={}, order_by=None): - pt = prettytable.PrettyTable([f for f in fields], - caching=False, print_empty=False) - pt.aligns = ['l' for f in fields] - - for o in objs: - row = [] - for field in fields: - if field in formatters: - row.append(formatters[field](o)) - else: - field_name = field.lower().replace(' ', '_') - data = getattr(o, field_name, '') - if data is None: - data = '' - row.append(data) - pt.add_row(row) - - if order_by is None: - order_by = fields[0] - encoded = encodeutils.safe_encode(pt.get_string(sortby=order_by)) - if six.PY3: - encoded = encoded.decode() - print(encoded) - - -def _word_wrap(string, max_length=0): - """wrap long strings to be no longer than max_length.""" - if max_length <= 0: - return string - return '\n'.join([string[i:i + max_length] for i in - range(0, len(string), max_length)]) - - -def print_dict(d, wrap=0): - """pretty table prints dictionaries. - - Wrap values to max_length wrap if wrap>0 - """ - pt = prettytable.PrettyTable(['Property', 'Value'], - caching=False, print_empty=False) - pt.aligns = ['l', 'l'] - for (prop, value) in six.iteritems(d): - if value is None: - value = '' - value = _word_wrap(value, max_length=wrap) - pt.add_row([prop, value]) - encoded = encodeutils.safe_encode(pt.get_string(sortby='Property')) - if six.PY3: - encoded = encoded.decode() - print(encoded) - - def find_resource(manager, name_or_id): """Helper for the _find_* methods.""" |