diff --git a/changelogs/fragments/python_requirements_facts_dashes.yml b/changelogs/fragments/python_requirements_facts_dashes.yml new file mode 100644 index 00000000000..725906dd21a --- /dev/null +++ b/changelogs/fragments/python_requirements_facts_dashes.yml @@ -0,0 +1,2 @@ +bugfixes: + - allow python_requirements_facts to report on dependencies containing dashes diff --git a/lib/ansible/modules/system/python_requirements_facts.py b/lib/ansible/modules/system/python_requirements_facts.py index 6e76665fae3..2066b4cdfcc 100644 --- a/lib/ansible/modules/system/python_requirements_facts.py +++ b/lib/ansible/modules/system/python_requirements_facts.py @@ -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=[], diff --git a/test/integration/targets/python_requirements_facts/aliases b/test/integration/targets/python_requirements_facts/aliases index ad7ccf7ada2..765b70da796 100644 --- a/test/integration/targets/python_requirements_facts/aliases +++ b/test/integration/targets/python_requirements_facts/aliases @@ -1 +1 @@ -unsupported +shippable/posix/group2