diff options
author | Louis Taylor <kragniz@gmail.com> | 2015-01-06 14:32:05 +0000 |
---|---|---|
committer | Louis Taylor <kragniz@gmail.com> | 2015-01-27 19:22:42 +0000 |
commit | b818826420a383e733ec40881ff436595ca57cc8 (patch) | |
tree | 12222b8c40f9cbdf22ecff0e2a99739cef18576e /glanceclient/v1 | |
parent | 363b17085195e6f38c8b7cf3ac3398f5f3806305 (diff) | |
download | python-glanceclient-b818826420a383e733ec40881ff436595ca57cc8.tar.gz |
Remove openstack.common.strutils
This module now lives in oslo.utils, so import it from there instead.
Co-Authored-By: Ian Cordasco <ian.cordasco@rackspace.com>
Change-Id: Ib35dc840992433542490670781badd9529ec8947
Diffstat (limited to 'glanceclient/v1')
-rw-r--r-- | glanceclient/v1/images.py | 7 | ||||
-rw-r--r-- | glanceclient/v1/shell.py | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/glanceclient/v1/images.py b/glanceclient/v1/images.py index e3a6e69..857b546 100644 --- a/glanceclient/v1/images.py +++ b/glanceclient/v1/images.py @@ -15,12 +15,13 @@ import copy +from oslo.utils import encodeutils +from oslo.utils import strutils import six import six.moves.urllib.parse as urlparse from glanceclient.common import utils from glanceclient.openstack.common.apiclient import base -from glanceclient.openstack.common import strutils UPDATE_PARAMS = ('name', 'disk_format', 'container_format', 'min_disk', 'min_ram', 'owner', 'size', 'is_public', 'protected', @@ -70,7 +71,7 @@ class ImageManager(base.ManagerWithFind): def _image_meta_from_headers(self, headers): meta = {'properties': {}} - safe_decode = strutils.safe_decode + safe_decode = encodeutils.safe_decode for key, value in six.iteritems(headers): value = safe_decode(value, incoming='utf-8') if key.startswith('x-image-meta-property-'): @@ -191,7 +192,7 @@ class ImageManager(base.ManagerWithFind): # # Making sure all params are str before # trying to encode them - qp[param] = strutils.safe_encode(value) + qp[param] = encodeutils.safe_decode(value) url = '/v1/images/detail?%s' % urlparse.urlencode(qp) images, resp = self._list(url, "images") diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py index 5d5452e..7cd8081 100644 --- a/glanceclient/v1/shell.py +++ b/glanceclient/v1/shell.py @@ -20,10 +20,12 @@ import functools import six import sys +from oslo.utils import encodeutils +from oslo.utils import strutils + from glanceclient.common import progressbar from glanceclient.common import utils from glanceclient import exc -from glanceclient.openstack.common import strutils import glanceclient.v1.images CONTAINER_FORMATS = 'Acceptable formats: ami, ari, aki, bare, and ovf.' @@ -327,7 +329,7 @@ def do_image_delete(gc, args): try: if args.verbose: print('Requesting image delete for %s ...' % - strutils.safe_encode(args_image), end=' ') + encodeutils.safe_decode(args_image), end=' ') gc.images.delete(image) |