From 5b3305c71505ffd4b0fd7dc5a6a17a4d5cb4cd77 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Sun, 19 May 2019 14:13:33 +1000 Subject: [PATCH] Allow python_requirements_facts to cope with packages with dashes ``` python_requirements_facts: dependencies: - kubernetes-validate ``` should work as expected --- changelogs/fragments/python_requirements_facts_dashes.yml | 2 ++ lib/ansible/modules/system/python_requirements_facts.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/python_requirements_facts_dashes.yml 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 ba1b01a7dbe..9048758bd7b 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=[],