diff options
author | Michael Scherer <misc@redhat.com> | 2016-10-18 07:54:59 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-18 07:20:54 -0700 |
commit | 92af91deb841bf6c89f4dc740bff50189fe03137 (patch) | |
tree | 9d4dcec627d57a7ff605b59ae41504f391f5d429 | |
parent | 000350b101d6d89d4681bb31676c4519a513c86b (diff) | |
download | ansible-modules-core-92af91deb841bf6c89f4dc740bff50189fe03137.tar.gz |
Make the code run on python 3
Test suite block on:
Traceback (most recent call last):
File "/tmp/ansible_fhootp1e/ansible_module_authorized_key.py", line 496, in <module>
main()
File "/tmp/ansible_fhootp1e/ansible_module_authorized_key.py", line 490, in main
results = enforce_state(module, module.params)
File "/tmp/ansible_fhootp1e/ansible_module_authorized_key.py", line 410, in enforce_state
parsed_new_key = parsekey(module, new_key)
File "/tmp/ansible_fhootp1e/ansible_module_authorized_key.py", line 308, in parsekey
options = parseoptions(module, options)
File "/tmp/ansible_fhootp1e/ansible_module_authorized_key.py", line 253, in parseoptions
if options_dict.has_key(key):
AttributeError: 'keydict' object has no attribute 'has_key'
With keydict being a subclass of dict.
(cherry picked from commit 3266efb02fcd80e60b8a9e4a783fc31e8249a523)
-rw-r--r-- | system/authorized_key.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/authorized_key.py b/system/authorized_key.py index 09e4bf30..3435cfc9 100644 --- a/system/authorized_key.py +++ b/system/authorized_key.py @@ -250,7 +250,7 @@ def parseoptions(module, options): for part in parts: if "=" in part: (key, value) = part.split("=", 1) - if options_dict.has_key(key): + if key in options_dict: if isinstance(options_dict[key], list): options_dict[key].append(value) else: |