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

Impossible to use version number in Ubuntu 16.04 #448

Closed
golinko opened this issue Nov 8, 2018 · 1 comment · Fixed by #451
Closed

Impossible to use version number in Ubuntu 16.04 #448

golinko opened this issue Nov 8, 2018 · 1 comment · Fixed by #451

Comments

@golinko
Copy link

golinko commented Nov 8, 2018

  • Puppet: 5.5.2
  • Ruby: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
  • Distribution: Ubuntu 16.04.2 LTS
  • Module version: v2.2.2

I want to make puppet install python3 on a host and use pip3 provider

My manifest:

 class { 'python':
    ensure => 'present',
    version => '3',
    pip     => 'latest',
  }
  python::pip { $package_id:
    ensure       => 'latest',
    pkgname      => $package_name,
    pip_provider => 'pip3',
  }

puppet run output error

Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install 3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package 3
Error: /Stage[main]/Python::Install/Package[python]/ensure: change from purged to latest failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install 3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package 3

If I try to use

version => 'python3'

I get:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, version needs to be within[system, pypy, 3, 3.3, 2.7]

Is it a bug or I miss something here?

I am new to puppet but I am just wondering when I will meet the condition here:

if "${::python::version}" =~ /^python3/ { #lint:ignore:only_variable_string

@jradmacher
Copy link
Contributor

I hit the same problem. To me it looks like two bugs:

  • version expects(= checks for) numbers, but does not add 'python' to the package name
  • the version list is hard coded per OS, so every version bump by the distribution requires updating this list. Also, custom repositories cannot be used, if they add "unexpected" python versions

Workaround:

 class { 'python':
    ensure => 'present',
    version => 'python3',
    valid_versions => 'python3',
    pip     => 'latest',
  }

YAML:

python::version: 'python3'
python::valid_versions: 'python3'

jradmacher added a commit to emetriq/puppet-python that referenced this issue Dec 6, 2018
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.
jradmacher added a commit to emetriq/puppet-python that referenced this issue Jan 2, 2019
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.

Note:
python version is needed for spec test
jradmacher added a commit to emetriq/puppet-python that referenced this issue Jan 3, 2019
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.

Note:
python version is needed for spec test
jradmacher added a commit to emetriq/puppet-python that referenced this issue Feb 12, 2019
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.

Note:
python version is needed for spec test
feltra pushed a commit to feltra/puppet-python that referenced this issue Mar 26, 2019
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.

Note:
python version is needed for spec test
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.

2 participants