Skip to content

Commit

Permalink
improve code readability and reduce code complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
benjixx committed May 3, 2018
1 parent 6217da9 commit e4e7ccf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions goodplay/ansible_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def is_playbook_file(path):


def is_playbook_content(content):
known_playbook_attributes = ('hosts', 'include', 'import_playbook')

return isinstance(content, list) \
and len(content) \
and isinstance(content[0], dict) \
and (content[0].get('hosts')
or content[0].get('include')
or content[0].get('import_playbook'))
and any(content[0].get(x) for x in known_playbook_attributes)

0 comments on commit e4e7ccf

Please sign in to comment.