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.
We ran into a situation where
pip
andvirtualenv
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 coursenil
doesn't have a[]
method.Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Run puppet with the
python
module on a system with brokenpip
and/orvirtualenv
commands.What are you seeing
Errors:
What behaviour did you expect instead
The
pip_version
andvirtualenv_version
facts should benil
when their respective commands are broken.