Skip to content

Commit

Permalink
Change regex for pip package versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Michael Dean committed Jul 20, 2016
1 parent 8056a3c commit 9cb84c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/pip.pp
Expand Up @@ -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 ? {
Expand Down Expand Up @@ -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}":
Expand Down

0 comments on commit 9cb84c2

Please sign in to comment.