diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2016-09-06 22:54:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 22:54:17 -0700 |
commit | 4ed88512e45112f9670560ac3f01707a40a7f5c5 (patch) | |
tree | 56a676d07eed2b298cde420decffa947a3869ff7 /lib/ansible/galaxy | |
parent | 7a9395b5e0059836fd510f252a9753229c4c24cc (diff) | |
download | ansible-4ed88512e45112f9670560ac3f01707a40a7f5c5.tar.gz |
Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because
of licensing. So once created it we had two sets of functions that did
the same things but had different implementations. To remedy that, this
change removes the ansible.utils.unicode versions of those functions.
Diffstat (limited to 'lib/ansible/galaxy')
-rw-r--r-- | lib/ansible/galaxy/api.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index 5dd9d75736..471c8eb4e9 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -28,12 +28,12 @@ import json import ansible.constants as C from ansible.compat.six import string_types -from ansible.compat.six.moves.urllib.parse import quote as urlquote, urlencode from ansible.compat.six.moves.urllib.error import HTTPError +from ansible.compat.six.moves.urllib.parse import quote as urlquote, urlencode from ansible.errors import AnsibleError -from ansible.module_utils.urls import open_url from ansible.galaxy.token import GalaxyToken -from ansible.utils.unicode import to_str +from ansible.module_utils._text import to_native +from ansible.module_utils.urls import open_url try: from __main__ import display @@ -115,12 +115,12 @@ class GalaxyAPI(object): try: return_data = open_url(url, validate_certs=self._validate_certs) except Exception as e: - raise AnsibleError("Failed to get data from the API server (%s): %s " % (url, to_str(e))) + raise AnsibleError("Failed to get data from the API server (%s): %s " % (url, to_native(e))) try: data = json.load(return_data) except Exception as e: - raise AnsibleError("Could not process data from the API server (%s): %s " % (url, to_str(e))) + raise AnsibleError("Could not process data from the API server (%s): %s " % (url, to_native(e))) if 'current_version' not in data: raise AnsibleError("missing required 'current_version' from server response (%s)" % url) |