Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module does not recognize Debian python package name #506

Closed
atayts opened this issue Aug 27, 2019 · 0 comments · Fixed by #514
Closed

Module does not recognize Debian python package name #506

atayts opened this issue Aug 27, 2019 · 0 comments · Fixed by #514

Comments

@atayts
Copy link

atayts commented Aug 27, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.3
  • Ruby: 2.4.4p296
  • Distribution: Debian 9
  • Module version: 3.0.1

How to reproduce (e.g Puppet code you use)

include python

python::ensure: present
python::version: 'python3'
python::pip: present
python::pip::botstrap::version: 'pip3'

What are you seeing

An error message 'version needs to be pypy, system or a version string like '36', '3.6' or 'python3.6''

What behaviour did you expect instead

Should be working.

Output log

Any additional information you'd like to impart

The cause of a problem is in init.pp code, line 68. It precludes from using a python version 'python3' as it expects a version to be two or more digits in a row or separated by a dot. Debian package is named 'python3' where a version is a single digit, thus not passing verfication of the regexp below.

  unless $version =~ Pattern[/\A(python)?[0-9](\.?[0-9])+/,
        /\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
    fail("version needs to be pypy, system or a version string like '36', '3.6' or 'python3.6' )")
  }

The fix is to replace '+' with '*' like this:

  unless $version =~ Pattern[/\A(python)?[0-9](\.?[0-9])*/,
  ...
lordievader added a commit to lordievader/puppet-python that referenced this issue Oct 28, 2019
Apply the suggested fix to recognize Debian python pacakges.
lordievader added a commit to lordievader/puppet-python that referenced this issue Nov 26, 2019
Apply the suggested fix to recognize Debian python pacakges.
baurmatt added a commit that referenced this issue Nov 26, 2019
Recognize Debian python package name, fixes: #506
krissik pushed a commit to krissik/puppet-python that referenced this issue Jul 30, 2020
Apply the suggested fix to recognize Debian python pacakges.
russellshackleford pushed a commit to russellshackleford/puppet-python that referenced this issue Sep 28, 2020
Apply the suggested fix to recognize Debian python pacakges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant