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

Duplicate declaration for python$version-venv #517

Closed
baurmatt opened this issue Nov 26, 2019 · 2 comments · Fixed by #518
Closed

Duplicate declaration for python$version-venv #517

baurmatt opened this issue Nov 26, 2019 · 2 comments · Fixed by #518

Comments

@baurmatt
Copy link
Contributor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.11.
  • Ruby: 2.5.7
  • Distribution: 18.04
  • Module version: Current master

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

$python_version = '3.6'
class { 'python':
  version => "python${python_version}",
}

python::pyvenv { '/opt/test1':
  version => $python_version,
}
python::pyvenv { '/opt/test2':
  version => $python_version,
}

What are you seeing

root@015a1178cad3:/# puppet apply --test --noop test.pp
Info: Loading facts
Info: Loading facts
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Package[python3.6-venv] is already declared at (file: /etc/puppetlabs/code/environments/production/modules/python/manifests/pyvenv.pp, line: 53); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/python/manifests/pyvenv.pp, line: 53) (file: /etc/puppetlabs/code/environments/production/modules/python/manifests/pyvenv.pp, line: 53, column: 11) (file: /test.pp, line: 9) on node 015a1178cad3

What behaviour did you expect instead

Creates two pyvenvs.

Output log

Any additional information you'd like to impart

@baurmatt
Copy link
Contributor Author

Will provide a PR

@baurmatt
Copy link
Contributor Author

Also reproducible with this code:

$python3_venv_package = 'python3.6-venv'

ensure_packages ($python3_venv_package, {
  before => File['/opt/test2'],
})
file { '/opt/test2':
  ensure => directory,
}

ensure_packages ($python3_venv_package, {
  before => File['/opt/test1'],
})
file { '/opt/test1':
  ensure => directory,
}

Could be introduced by puppetlabs/puppetlabs-stdlib@9cdbbcc#diff-371173ef002424744f2dbf1a0afdfcd6

baurmatt added a commit to syseleven/puppet-python that referenced this issue Nov 26, 2019
baurmatt added a commit to syseleven/puppet-python that referenced this issue Nov 26, 2019
baurmatt added a commit to syseleven/puppet-python that referenced this issue Nov 26, 2019
baurmatt added a commit to syseleven/puppet-python that referenced this issue Nov 26, 2019
krissik pushed a commit to krissik/puppet-python that referenced this issue Jul 30, 2020
russellshackleford pushed a commit to russellshackleford/puppet-python that referenced this issue Sep 28, 2020
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