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

Call, 'versioncmp' parameter 'a' expects a String value, got Undef #262

Closed
jonlil opened this issue Nov 20, 2015 · 3 comments
Closed

Call, 'versioncmp' parameter 'a' expects a String value, got Undef #262

jonlil opened this issue Nov 20, 2015 · 3 comments

Comments

@jonlil
Copy link

jonlil commented Nov 20, 2015

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'versioncmp' parameter 'a' expects a String value, got Undef at /etc/puppetlabs/code/environments/production/modules/python/manifests/virtualenv.pp:122:11

puppet 4.2, puppet-python 1.10.0

@jonlil
Copy link
Author

jonlil commented Nov 20, 2015

i'm using ubuntu 14.04

@anthonymf
Copy link

I found this bug too. I think the problem is this: the virtualenv_version custom facter fact fails to return a version string if virtualenv is not installed.

I haven't got time to raise a PR but I think this is a fix:

https://github.com/stankevich/puppet-python/blob/c2ca9d7495375bde781d766b3e6d3dd59cfbbed3/lib/facter/virtualenv_version.rb#L6
Change
Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(/^(\d+\.\d+\.?\d*).*$/)[0]
to
Facter::Util::Resolution.exec('virtualenv --version 2>/dev/null || echo 0.0.0').match(/^(\d+\.\d+\.?\d*).*$/)[0]

@anthonymf
Copy link

:-)

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

No branches or pull requests

2 participants