diff --git a/changelogs/fragments/python_requirements_facts_dashes.yml b/changelogs/fragments/python_requirements_facts_dashes.yml new file mode 100644 index 0000000000..725906dd21 --- /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 ba1b01a7db..9048758bd7 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 ad7ccf7ada..765b70da79 100644 --- a/test/integration/targets/python_requirements_facts/aliases +++ b/test/integration/targets/python_requirements_facts/aliases @@ -1 +1 @@ -unsupported +shippable/posix/group2