python::pip falls through to uninstalling the package if ensure doesn't match one of the patterns

Open
#478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
devops

Research direction

Start with manifests/pip.pp around line 274 and reproduce the provided python::pip resource using an unrecognized ensure value. Done means the resource reports an error for that value and does not run the uninstall action.

Written by the indexing model from the issue text.

Description

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.7.2
  • Ruby: 2.1.5p273
  • Distribution: Debian
  • Module version: v2.1.1

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

python::pip { 'wal-e' :
ensure => 'v1.1.0',
pkgname => 'wal-e',
pip_provider => 'pip',
virtualenv => '/var/local/py-virtual-env/wal-e',
owner => 'root',
extras => ['aws'],
timeout => 1800
}

What are you seeing

python::pip uninstalls the wal-e package because uninstall is the default:
https://github.com/voxpupuli/puppet-python/blob/master/manifests/pip.pp#L274

What behaviour did you expect instead

An error on an unrecognized value instead of a default action of removing the package.

Output log

Notice: /Stage[main]/Nni::Wal_e_virtualenv/Python::Pip[wal-e]/Exec[pip_uninstall_wal-e]/returns: executed successfully

Any additional information you'd like to impart

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.