puppet-python
puppet-python copied to clipboard
Virtualenv>=20.0.0 has new version command output breaking virtualenv_version fact
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.
for what it's worth, there's additional issues beyond fixing the version fact regex. latest virtualenv removed the deprecated --no-site-packages CLI flag.
as a workaround, is there a way to specify a virtualenv to use version explicitly?
Am seeing this issue too. Do we have any estimates on when an official fix will be available?
We will need a new version of puppet-puppetboard to be released with support for puppet-python up to 4.1.1 so we can clear this issue from our Puppet environments.
This issue is resolved in version 4.1.1
Hi @krissik and @pjonesIDBS I was looking at this, and running into issues. It turned out my issues were due to not declaring syspkgs, BUT, I do think you're regex update in the commit here is incorrect. You're pointing to value [1] will return "from" instead of the actual virtualenv version number. I tested this by forking and adding a simple notify statement in a puppetfile to print out the value.
I created a PR based on the above comment, not 100% certain how it works with your current version tagging: https://github.com/voxpupuli/puppet-python/pull/557
@GusPriceAtlassian, thanks for the feedback. What OS and release are you running? I'm unable to replicate your problem. The change you've proposed in #557 actually breaks things again on a CentOS 7 system. Maybe the issue relates to the version of Ruby and how it's match regex function is working.
I'm on CentOS 7 as well, specifically this AMI in AWS: https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW
I will move this conversation to my PR.