Use oslo_utils encodeutils and strutils
With oslo-incubator being deprecated, move our use of strutils to oslo_utils. This leaves in place the use of oslo-incubator's strutils by other oslo-incubator modules for now. Change-Id: Ic4e50060b42aeca9d1e54424a8a3a123140fbf2a
This commit is contained in:
@@ -32,8 +32,8 @@ import requests
|
||||
|
||||
from cinderclient import exceptions
|
||||
from cinderclient.openstack.common import importutils
|
||||
from cinderclient.openstack.common import strutils
|
||||
from cinderclient.openstack.common.gettextutils import _
|
||||
from oslo_utils import strutils
|
||||
|
||||
osprofiler_web = importutils.try_import("osprofiler.web")
|
||||
|
||||
|
@@ -38,7 +38,6 @@ from cinderclient import utils
|
||||
import cinderclient.auth_plugin
|
||||
import cinderclient.extension
|
||||
from cinderclient.openstack.common import importutils
|
||||
from cinderclient.openstack.common import strutils
|
||||
from cinderclient.openstack.common.gettextutils import _
|
||||
from cinderclient.v1 import shell as shell_v1
|
||||
from cinderclient.v2 import shell as shell_v2
|
||||
@@ -49,6 +48,8 @@ from keystoneclient.auth.identity import v2 as v2_auth
|
||||
from keystoneclient.auth.identity import v3 as v3_auth
|
||||
from keystoneclient.exceptions import DiscoveryFailure
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import strutils
|
||||
|
||||
osprofiler_profiler = importutils.try_import("osprofiler.profiler")
|
||||
|
||||
@@ -902,7 +903,7 @@ def main():
|
||||
if sys.version_info >= (3, 0):
|
||||
OpenStackCinderShell().main(sys.argv[1:])
|
||||
else:
|
||||
OpenStackCinderShell().main(map(strutils.safe_decode,
|
||||
OpenStackCinderShell().main(map(encodeutils.safe_decode,
|
||||
sys.argv[1:]))
|
||||
except KeyboardInterrupt:
|
||||
print("... terminating cinder client", file=sys.stderr)
|
||||
|
@@ -24,7 +24,7 @@ import six
|
||||
import prettytable
|
||||
|
||||
from cinderclient import exceptions
|
||||
from cinderclient.openstack.common import strutils
|
||||
from oslo_utils import encodeutils
|
||||
|
||||
|
||||
def arg(*args, **kwargs):
|
||||
@@ -107,7 +107,7 @@ def _print(pt, order):
|
||||
if sys.version_info >= (3, 0):
|
||||
print(pt.get_string(sortby=order))
|
||||
else:
|
||||
print(strutils.safe_encode(pt.get_string(sortby=order)))
|
||||
print(encodeutils.safe_encode(pt.get_string(sortby=order)))
|
||||
|
||||
|
||||
def print_list(objs, fields, exclude_unavailable=False, formatters=None,
|
||||
@@ -198,7 +198,7 @@ def find_resource(manager, name_or_id):
|
||||
pass
|
||||
|
||||
if sys.version_info <= (3, 0):
|
||||
name_or_id = strutils.safe_decode(name_or_id)
|
||||
name_or_id = encodeutils.safe_decode(name_or_id)
|
||||
|
||||
try:
|
||||
try:
|
||||
|
@@ -25,9 +25,9 @@ import sys
|
||||
import time
|
||||
|
||||
from cinderclient import exceptions
|
||||
from cinderclient.openstack.common import strutils
|
||||
from cinderclient import utils
|
||||
from cinderclient.v1 import availability_zones
|
||||
from oslo_utils import strutils
|
||||
|
||||
|
||||
def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
|
||||
|
@@ -27,8 +27,8 @@ import six
|
||||
from cinderclient import base
|
||||
from cinderclient import exceptions
|
||||
from cinderclient import utils
|
||||
from cinderclient.openstack.common import strutils
|
||||
from cinderclient.v2 import availability_zones
|
||||
from oslo_utils import strutils
|
||||
|
||||
|
||||
def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
|
||||
|
@@ -9,3 +9,4 @@ requests!=2.8.0,>=2.5.2
|
||||
simplejson>=2.2.0
|
||||
Babel>=1.3
|
||||
six>=1.9.0
|
||||
oslo.utils>=2.8.0 # Apache-2.0
|
||||
|
Reference in New Issue
Block a user