Skip to content

Commit

Permalink
Allow python_requirements_facts to cope with packages with dashes
Browse files Browse the repository at this point in the history
```
python_requirements_facts:
  dependencies:
    - kubernetes-validate
```

should work as expected

(cherry picked from commit 5b3305c)
  • Loading branch information
willthames committed May 21, 2019
1 parent 0cfc338 commit 4bf5985
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/python_requirements_facts_dashes.yml
@@ -0,0 +1,2 @@
bugfixes:
- allow python_requirements_facts to report on dependencies containing dashes
2 changes: 1 addition & 1 deletion lib/ansible/modules/system/python_requirements_facts.py
Expand Up @@ -123,7 +123,7 @@ def main():
python_version=sys.version,
python_system_path=sys.path,
)
pkg_dep_re = re.compile(r'(^[a-zA-Z][a-zA-Z0-9_]+)(==|[><]=?)?([0-9.]+)?$')
pkg_dep_re = re.compile(r'(^[a-zA-Z][a-zA-Z0-9_-]+)(==|[><]=?)?([0-9.]+)?$')

results = dict(
not_found=[],
Expand Down

0 comments on commit 4bf5985

Please sign in to comment.