Virtualenv>=20.0.0 has new version command output breaking virtualenv_version fact

Open
#534 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Read lib/facter/virtualenv_version.rb and reproduce the fact with both virtualenv --version outputs shown in the issue. Update the parsing so virtualenv_version is defined for versions before and from 20.0.0, then verify the fact no longer raises the reported nil error.

Written by the indexing model from the issue text.

Description

Affected Puppet, Ruby, OS and module versions/distributions

We are running old everything, but the facter fact, https://github.com/voxpupuli/puppet-python/blob/master/lib/facter/virtualenv_version.rb, hasn't been changed in a while.

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

Try to use virtualenv_version fact when virtualenv>=20.0.0 is installed

What are you seeing

error while resolving custom fact "virtualenv_version": undefined method `[]' for nil:NilClass

What behaviour did you expect instead

virtualenv_version is defined with a version value.

Any additional information you'd like to impart

This happens because virtualenv>=20.0.0 is a major rewrite and changes the output of the virtualenv --version command.

Old virtualenv:

$ virtualenv --version
16.7.5

New virtualenv:

$ ~/venv/bin/virtualenv --version
virtualenv 20.0.1 from /home/clark/venv/lib/python2.7/site-packages/virtualenv/__init__.pyc

The fact's output parsing will need to be updated to handle both cases.

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.