Browse Source

Removing decode(UTF-8) to make python compatible

Now that python3 it's already UTF-8 compatible, there is no
need to decode from UTF-8 anymore. We just need to use
six.text_type() instead.

Change-Id: Ica16721ca43300bc51b292591a3cfa602944df3d
changes/29/670829/3
Raildo Mascena 2 months ago
parent
commit
424b981b30
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      novajoin_tempest_plugin/ipa/ipa_client.py

+ 7
- 6
novajoin_tempest_plugin/ipa/ipa_client.py View File

@@ -14,6 +14,7 @@
14 14
 #    under the License.
15 15
 
16 16
 import os
17
+import six
17 18
 import time
18 19
 import uuid
19 20
 try:
@@ -163,25 +164,25 @@ class IPABase(object):
163 164
 class IPAClient(IPABase):
164 165
 
165 166
     def find_host(self, hostname):
166
-        params = [hostname.decode('UTF-8')]
167
+        params = [six.text_type(hostname)]
167 168
         return self._call_ipa('host_find', *params)
168 169
 
169 170
     def show_host(self, hostname):
170
-        params = [hostname.decode('UTF-8')]
171
+        params = [six.text_type(hostname)]
171 172
         return self._call_ipa('host_show', *params)
172 173
 
173 174
     def find_service(self, service_principal):
174
-        params = [service_principal.decode('UTF-8')]
175
+        params = [six.text_type(service_principal)]
175 176
         service_args = {}
176 177
         return self._call_ipa('service_find', *params, **service_args)
177 178
 
178 179
     def show_service(self, service_principal):
179
-        params = [service_principal.decode('UTF-8')]
180
+        params = [six.text_type(service_principal)]
180 181
         service_args = {}
181 182
         return self._call_ipa('service_show', *params, **service_args)
182 183
 
183 184
     def get_service_cert(self, service_principal):
184
-        params = [service_principal.decode('UTF-8')]
185
+        params = [six.text_type(service_principal)]
185 186
         service_args = {}
186 187
         result = self._call_ipa('service_find', *params, **service_args)
187 188
         serviceresult = result['result'][0]
@@ -192,7 +193,7 @@ class IPAClient(IPABase):
192 193
 
193 194
     def service_managed_by_host(self, service_principal, host):
194 195
         """Return True if service is managed by specified host"""
195
-        params = [service_principal.decode('UTF-8')]
196
+        params = [six.text_type(service_principal)]
196 197
         service_args = {}
197 198
         try:
198 199
             result = self._call_ipa('service_show', *params, **service_args)

Loading…
Cancel
Save