Port the aix_inittab to python 3 (#45678)
Since izip no longer exist on python 3, we need to use zip Fix #45220
This commit is contained in:
parent
84a4257774
commit
5c49641798
1 changed files with 7 additions and 2 deletions
|
@ -118,7 +118,12 @@ changed:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# Import necessary libraries
|
# Import necessary libraries
|
||||||
import itertools
|
try:
|
||||||
|
# python 2
|
||||||
|
from itertools import izip
|
||||||
|
except ImportError:
|
||||||
|
izip = zip
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
# end import modules
|
# end import modules
|
||||||
|
@ -136,7 +141,7 @@ def check_current_entry(module):
|
||||||
values = out.split(":")
|
values = out.split(":")
|
||||||
# strip non readable characters as \n
|
# strip non readable characters as \n
|
||||||
values = map(lambda s: s.strip(), values)
|
values = map(lambda s: s.strip(), values)
|
||||||
existsdict = dict(itertools.izip(keys, values))
|
existsdict = dict(izip(keys, values))
|
||||||
existsdict.update({'exist': True})
|
existsdict.update({'exist': True})
|
||||||
return existsdict
|
return existsdict
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue