Skip to content

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

@cboylan

Description

@cboylan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions