Conditionally decode hosts
TripleO was using python2 up to stable/train. This means we can .decode() strings, which we did with hosts for hostnames. With python3, we no longer need to do this and tripleo master is using python3. Instead, we need to detect this case and handle it appropriately. Change-Id: Icc211f5b685ec9df06cd25d6af3b28a5db4df590
This commit is contained in:
parent
668d971ceb
commit
d2e3b35c02
@ -346,7 +346,10 @@ def cleanup_ipa_services(keytab, hosts):
|
||||
|
||||
hosts_to_delete = set()
|
||||
for host in hosts:
|
||||
hostname = host.decode('UTF-8')
|
||||
if six.PY3:
|
||||
hostname = host
|
||||
else:
|
||||
hostname = host.decode('UTF-8')
|
||||
if ipa.find_host(hostname):
|
||||
hosts_to_delete.add(hostname)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user