From 9cb84c2799e020d9731fded9b7a90ba63591de47 Mon Sep 17 00:00:00 2001 From: Michael Dean Date: Wed, 20 Jul 2016 15:01:15 -0500 Subject: [PATCH] Change regex for pip package versions Was able to match examples found here: https://www.python.org/dev/peps/pep-0440 The problem we encountered was specifically with Airflow and version 1.7.1.3. --- manifests/pip.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/pip.pp b/manifests/pip.pp index 50d0311f..41a6dd2c 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -147,7 +147,7 @@ } # Check if searching by explicit version. - if $ensure =~ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.[0-9]+(\.[0-9]+)?)$/ { + if $ensure =~ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.\w+\+?\w*(\.\w+)*)$/ { $grep_regex = "^${pkgname}==${ensure}\$" } else { $grep_regex = $pkgname ? { @@ -209,7 +209,7 @@ } } else { case $ensure { - /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.[0-9]+(\.[0-9]+)?)$/: { + /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.\w+\+?\w*(\.\w+)*)$/: { # Version formats as per http://guide.python-distribute.org/specification.html#standard-versioning-schemes # Explicit version. exec { "pip_install_${name}":