Merge "Use oslo.utils"

This commit is contained in:
Jenkins
2014-08-15 18:53:44 +00:00
committed by Gerrit Code Review
4 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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