Hard bind cliff dependency and minor unicode fixes

Newer versions of cliff have an issue where unicode strings
are not handled correctly in output so we hard bind the
requirements to a version of cliff we know doesn't have
the problem.  Also we were only doing the unicode translation
when outputing to a table where there were are few other
output formats where the translation was also appropriate.

Change-Id: I04f7988f5ff01f7434687fade5465b87199b86ba
This commit is contained in:
Borne Mace 2017-05-31 09:32:17 -07:00
parent 2ee8db4613
commit 03db2832f1
3 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# Copyright(c) 2016, Oracle and/or its affiliates. All Rights Reserved.
# Copyright(c) 2017, Oracle and/or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -399,10 +399,11 @@ def convert_lists_to_string(tuples, parsed_args):
(\u0414\u0435\u043a\u0430\u0442). By converting
the list to string here, the proper non-ascii chars are displayed.
This will only change the lists when the output is to a table. It cannot
be changed if the display output is json, yaml, etc.
This will only change the lists when the output is to a user visible medium.
It cannot be changed if the display output is json, yaml, etc.
"""
if parsed_args.formatter and parsed_args.formatter != 'table':
convert_types = ['table', 'csv', 'html', 'value']
if parsed_args.formatter and parsed_args.formatter not in convert_types:
# not table output, leave it as-is
return tuples

View File

@ -1,7 +1,7 @@
ansible>=1.9.2
Babel>=0.9.6
cliff>=1.13.0 # Apache-2.0
cliff-tablib>=1.1
cliff==1.13.0 # Apache-2.0
cliff-tablib<=1.1
jsonpickle>=0.9
oslo.i18n>=1.3.0 # Apache-2.0
paramiko>=1.15

View File

@ -348,7 +348,7 @@ class TestConfig(object):
if hosts_info:
for hostname, host_info in hosts_info.items():
uname = host_info['uname']
pwd = host_info['pwd']
pwd = host_info.get('pwd', '')
self.add_host(hostname)
self.set_password(hostname, pwd)
self.set_username(hostname, uname)