mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-15 13:39:10 -07:00
Python 3 fixes for ansible-doc.
This commit is contained in:
parent
b18263cf36
commit
88dbb5a630
2 changed files with 5 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue