From 7b98ff6a318cfa857dbcff17169f59f9b91046c9 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Fri, 8 Mar 2019 22:53:46 -0600 Subject: [PATCH] fix pkg name nevra parsing regex in dnf (#53572) --- changelogs/fragments/dnf-packagename-parse.yaml | 4 ++++ lib/ansible/modules/packaging/os/dnf.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/dnf-packagename-parse.yaml diff --git a/changelogs/fragments/dnf-packagename-parse.yaml b/changelogs/fragments/dnf-packagename-parse.yaml new file mode 100644 index 00000000000..a50182a9142 --- /dev/null +++ b/changelogs/fragments/dnf-packagename-parse.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - 'dnf - fix package parsing to handle git snapshot nevra' + - 'dnf - enable package name specification for absent' diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index 9ef66cd0e6c..9e791218178 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -383,7 +383,7 @@ class DnfModule(YumDnf): ] rpm_arch_re = re.compile(r'(.*)\.(.*)') - rpm_nevr_re = re.compile(r'(\S+)-(?:(\d*):)?(.*)-(~?\w+[\w.]*)') + rpm_nevr_re = re.compile(r'(\S+)-(?:(\d*):)?(.*)-(~?\w+[\w.+]*)') try: arch = None rpm_arch_match = rpm_arch_re.match(packagename)