From 68c2fad55a71ca511ff959e589aa0a3f3dbd4b78 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Tue, 5 Aug 2014 17:57:46 -0500 Subject: [PATCH] Use oslo.utils keystoneclient was using utility function from oslo-incubator rather than oslo.utils. Change-Id: I2909a2150b9556e54ef88e72358fda1cf8b7cc1c --- keystoneclient/session.py | 2 +- keystoneclient/shell.py | 4 ++-- keystoneclient/utils.py | 6 +++--- keystoneclient/v2_0/shell.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keystoneclient/session.py b/keystoneclient/session.py index 26b95e1ee..61e1b5812 100644 --- a/keystoneclient/session.py +++ b/keystoneclient/session.py @@ -15,12 +15,12 @@ import logging import os from oslo.config import cfg +from oslo.utils import importutils import requests import six from six.moves import urllib from keystoneclient import exceptions -from keystoneclient.openstack.common import importutils from keystoneclient.openstack.common import jsonutils from keystoneclient import utils diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index 61b93e958..7edd35530 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -30,6 +30,7 @@ import logging import os import sys +from oslo.utils import encodeutils import six import keystoneclient @@ -37,7 +38,6 @@ from keystoneclient import access from keystoneclient.contrib.bootstrap import shell as shell_bootstrap from keystoneclient import exceptions as exc from keystoneclient.generic import shell as shell_generic -from keystoneclient.openstack.common import strutils from keystoneclient import session from keystoneclient import utils from keystoneclient.v2_0 import shell as shell_v2_0 @@ -461,7 +461,7 @@ def main(): OpenStackIdentityShell().main(sys.argv[1:]) except Exception as e: - print(strutils.safe_encode(six.text_type(e)), file=sys.stderr) + print(encodeutils.safe_encode(six.text_type(e)), file=sys.stderr) sys.exit(1) diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py index d3342f48f..436b2f61c 100644 --- a/keystoneclient/utils.py +++ b/keystoneclient/utils.py @@ -17,11 +17,11 @@ import inspect import logging import sys +from oslo.utils import encodeutils import prettytable import six from keystoneclient import exceptions -from keystoneclient.openstack.common import strutils logger = logging.getLogger(__name__) @@ -61,7 +61,7 @@ def print_list(objs, fields, formatters={}, order_by=None): if order_by is None: order_by = fields[0] - encoded = strutils.safe_encode(pt.get_string(sortby=order_by)) + encoded = encodeutils.safe_encode(pt.get_string(sortby=order_by)) if six.PY3: encoded = encoded.decode() print(encoded) @@ -88,7 +88,7 @@ def print_dict(d, wrap=0): value = '' value = _word_wrap(value, max_length=wrap) pt.add_row([prop, value]) - encoded = strutils.safe_encode(pt.get_string(sortby='Property')) + encoded = encodeutils.safe_encode(pt.get_string(sortby='Property')) if six.PY3: encoded = encoded.decode() print(encoded) diff --git a/keystoneclient/v2_0/shell.py b/keystoneclient/v2_0/shell.py index 5d8d2652c..976fb1e6d 100755 --- a/keystoneclient/v2_0/shell.py +++ b/keystoneclient/v2_0/shell.py @@ -26,9 +26,9 @@ import argparse import getpass import sys +from oslo.utils import strutils import six -from keystoneclient.openstack.common import strutils from keystoneclient import utils from keystoneclient.v2_0 import client