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

"undefined method []" in pip_version and virtualenv_version facts #527

Closed
alanwevans opened this issue Dec 10, 2019 · 0 comments · Fixed by #555
Closed

"undefined method []" in pip_version and virtualenv_version facts #527

alanwevans opened this issue Dec 10, 2019 · 0 comments · Fixed by #555

Comments

@alanwevans
Copy link

We ran into a situation where pip and virtualenv were in the PATH on a particular system but referred to a non-existent python installation.

In both cases the facts are generated by using a regex match against the stdout/stderr of the relevant commands. When the regex fails to produce a match it returns nil instead and of course nil doesn't have a [] method.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.9.0
  • Ruby: 2.5.3p105
  • Distribution: CentOS 7
  • Module version: 3.0.1

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

Run puppet with the python module on a system with broken pip and/or virtualenv commands.

What are you seeing

Errors:

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

What behaviour did you expect instead

The pip_version and virtualenv_version facts should be nil when their respective commands are broken.

wiebe added a commit to wiebe/puppet-python that referenced this issue Jul 21, 2020
wiebe added a commit to wiebe/puppet-python that referenced this issue Jul 21, 2020
wiebe added a commit to wiebe/puppet-python that referenced this issue Jul 21, 2020
wiebe added a commit to wiebe/puppet-python that referenced this issue Jul 21, 2020
russellshackleford pushed a commit to russellshackleford/puppet-python that referenced this issue Sep 28, 2020
russellshackleford pushed a commit to russellshackleford/puppet-python that referenced this issue Sep 28, 2020
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

Successfully merging a pull request may close this issue.

1 participant