Regex doesn't work for version which contains '+' symbol

Open
#454 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
ruby
Domain
devops

Research direction

Start in puppet-python/manifests/pip.pp at the regexes on lines 136 and 209, using the reported Puppet and module versions as context. Reproduce the ensure_resource example with version 1.8.0+apache.incubating, then verify that the version is accepted and the module no longer attempts to uninstall airflow.

Written by the indexing model from the issue text.

Description

Hi,
Puppet 4.10.0
Module version: v1.18.2

I try install airflow from url but puppet tries to uninstall it.

ensure_resource(python::pip, 'airflow', {url => https://github.airflow/arhive/1.8.0.zip, pkgname => 'airflow', ensure => '1.8.0+apache.incubating')

Issue is that your regex doesn't like '+' in the version string '1.8.0+apache.incubating'.
file: puppet-python/manifests/pip.pp
strings:
136 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+)*)$/ {
209 /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.\w+\+?\w*(\.\w+)*)$/: {

Thank Pav

Dominant language
Ruby
Stars
196
Forks
372
Avg merge
1d 18m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from voxpupuli/puppet-python

All issues in voxpupuli/puppet-python

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.