Python 3 fixes for ansible-doc.

This commit is contained in:
Matt Clay 2016-11-03 15:46:12 -07:00 committed by Toshio Kuratomi
parent b18263cf36
commit 88dbb5a630
2 changed files with 5 additions and 5 deletions

View file

@ -97,10 +97,10 @@ def get_docstring(filename, verbose=False):
fragment_yaml = getattr(fragment_class, fragment_var, '{}')
fragment = AnsibleLoader(fragment_yaml, file_name=filename).get_single_data()
if fragment.has_key('notes'):
if 'notes' in fragment:
notes = fragment.pop('notes')
if notes:
if not doc.has_key('notes'):
if 'notes' not in doc:
doc['notes'] = []
doc['notes'].extend(notes)
@ -108,7 +108,7 @@ def get_docstring(filename, verbose=False):
raise Exception("missing options in fragment, possibly misformatted?")
for key, value in fragment.items():
if not doc.has_key(key):
if key not in doc:
doc[key] = value
else:
if isinstance(doc[key], MutableMapping):