Ask Your Question
0

Keystone Client Always output 'printt'

asked 2013-03-06 02:52:24 -0500

binary-huang gravatar image

I have install the essex version of keystone. And now I have download the python-keystoneclient from github. But whatever version of python-keystoneclient I use, the output of this command 'keystone --token=ADMIN --endpoint=url service-list' will be 'printt'

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-21 05:57:17 -0500

Please double check your python-keystoneclient version.

Taking version 0.2.2.48.gd8982e7 as an example, it uses get_string instead of printt. So it will not have your problem.

[python-keystoneclient]$ grep -r --after 10 prettytable keystoneclient/ keystoneclient/utils.py:import prettytable keystoneclient/utils.py- keystoneclient/utils.py-from keystoneclient import exceptions keystoneclient/utils.py- keystoneclient/utils.py- keystoneclient/utils.py-# Decorator for cli-args keystoneclient/utils.py-def arg(args, *kwargs): keystoneclient/utils.py- def _decorator(func): keystoneclient/utils.py- # Because of the sematics of decorator composition if we just append keystoneclient/utils.py- # to the options list positional options will appear to be backwards.

keystoneclient/utils.py- func.__dict__.setdefault('arguments', []).insert(0, (args, kwargs))

keystoneclient/utils.py: pt = prettytable.PrettyTable([f for f in fields], caching=False) keystoneclient/utils.py- pt.aligns = ['l' for f in fields] keystoneclient/utils.py- keystoneclient/utils.py- for o in objs: keystoneclient/utils.py- row = [] keystoneclient/utils.py- for field in fields: keystoneclient/utils.py- if field in formatters: keystoneclient/utils.py- row.append(formattersfield) keystoneclient/utils.py- else: keystoneclient/utils.py- field_name = field.lower().replace(' ', '_')

keystoneclient/utils.py- data = getattr(o, field_name, '')

keystoneclient/utils.py: pt = prettytable.PrettyTable(['Property', 'Value'], caching=False) keystoneclient/utils.py- pt.aligns = ['l', 'l'] keystoneclient/utils.py- for (prop, value) in d.iteritems(): keystoneclient/utils.py- if value is None: keystoneclient/utils.py- value = '' keystoneclient/utils.py- value = _word_wrap(value, max_length=wrap) keystoneclient/utils.py- pt.add_row([prop, value]) keystoneclient/utils.py- print pt.get_string(sortby='Property') keystoneclient/utils.py- keystoneclient/utils.py- keystoneclient/utils.py-def find_resource(manager, name_or_id): Binary file keystoneclient/utils.pyc matches [cl@cl55 python-keystoneclient]$ grep -r --after 20 prettytable keystoneclient/ keystoneclient/utils.py:import prettytable keystoneclient/utils.py- keystoneclient/utils.py-from keystoneclient import exceptions keystoneclient/utils.py- keystoneclient/utils.py- keystoneclient/utils.py-# Decorator for cli-args keystoneclient/utils.py-def arg(args, *kwargs): keystoneclient/utils.py- def _decorator(func): keystoneclient/utils.py- # Because of the sematics of decorator composition if we just append keystoneclient/utils.py- # to the options list positional options will appear to be backwards. keystoneclient/utils.py- func.__dict__.setdefault('arguments', []).insert(0, (args, kwargs)) keystoneclient/utils.py- return func keystoneclient/utils.py- return _decorator keystoneclient/utils.py- keystoneclient/utils.py- keystoneclient/utils.py-def pretty_choice_list(l): keystoneclient/utils.py- return ', '.join("'%s'" % i for i in l) keystoneclient/utils.py- keystoneclient/utils.py- keystoneclient/utils.py-def print_list(objs, fields, formatters={}, order_by=None): keystoneclient/utils.py: pt = prettytable.PrettyTable([f for f in fields], caching=False) keystoneclient/utils.py- pt.aligns = ['l' for f in fields] keystoneclient/utils.py- keystoneclient/utils.py- for o in objs: keystoneclient/utils.py- row = [] keystoneclient/utils.py- for field in fields: keystoneclient/utils.py- if field in formatters: keystoneclient/utils.py- row.append(formattersfield) keystoneclient/utils.py- else: keystoneclient/utils.py- field_name = field.lower().replace(' ', '_') keystoneclient/utils.py- data = getattr(o, field_name, '') keystoneclient/utils.py- if data is None: keystoneclient/utils.py- data = '' keystoneclient/utils.py- row.append(data) keystoneclient/utils.py- pt.add_row ... (more)

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-03-06 02:52:24 -0500

Seen: 91 times

Last updated: Mar 21 '13