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

python3_version fact doesn't work on SCL #475

Closed
bodgit opened this issue Apr 10, 2019 · 0 comments · Fixed by #472
Closed

python3_version fact doesn't work on SCL #475

bodgit opened this issue Apr 10, 2019 · 0 comments · Fixed by #472

Comments

@bodgit
Copy link
Contributor

bodgit commented Apr 10, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.x
  • Ruby:
  • Distribution: Red Hat
  • Module version: 2.2.3-rc0

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

Commits 72c34fa and 3d102f4 have added the python3_version fact in the python::pyvenv defined type however this fact doesn't resolve to anything with SCL as the various binaries are not in $PATH by default.

What are you seeing

Various errors along the lines of:

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 (file: /.../python/manifests/pyvenv.pp, line: 62, column: 9)

What behaviour did you expect instead

If I explicitly set the version parameter for python::pyvenv then I can skip over the first use of the fact here:

'system' => $facts['python3_version'],

But then I still fall foul here:

if (versioncmp($facts['python3_version'], '3.6') >=0) {

It's probably better to use the computed/normalised version string in this call to versioncmp() rather than use the fact again.

$::python::exec_prefix is already set up correctly so after these checks complete the correct SCL-provided python binaries are used.

Output log

Any additional information you'd like to impart

I'll add a fix for this to my existing #472 PR.

@bodgit bodgit changed the title python3_version facts don't work on SCL python3_version fact doesn't work on SCL Apr 10, 2019
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