Skip to content

Commit

Permalink
galaxy: fix AttributeError on empty requirements.yml (ansible#66726)
Browse files Browse the repository at this point in the history
* galaxy: fix AttributeError on empty requirements.yml

* add changelog
  • Loading branch information
resmo authored and jborean93 committed Jan 23, 2020
1 parent 5c721e8 commit 9e8fb5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/66726-galaxy-fix-attribute-error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- galaxy - Fix an AttributeError on ansible-galaxy install with an empty requirements.yml (https://github.com/ansible/ansible/issues/66725).
2 changes: 1 addition & 1 deletion lib/ansible/cli/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def _parse_requirements_file(self, requirements_file, allow_old_format=True):
"Failed to parse the requirements yml at '%s' with the following error:\n%s"
% (to_native(requirements_file), to_native(err)))

if requirements_file is None:
if file_requirements is None:
raise AnsibleError("No requirements found in file '%s'" % to_native(requirements_file))

def parse_role_req(requirement):
Expand Down

0 comments on commit 9e8fb5b

Please sign in to comment.