voxpupuli / puppet-python

Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
https://forge.puppetlabs.com/puppet/python
Apache License 2.0
199 stars 370 forks source link

Unknown function 'fact' python/manifests/install.pp, line: 269 #570

Closed n1md4 closed 3 years ago

n1md4 commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

from the example code:

python::python_pyvenvs:
  "/opt/env1":
    version: "system"
  "/opt/env2":
    version: "system"
python::python_pips:
  "nose":
    virtualenv: "/opt/env1"
  "coverage":
    virtualenv: "/opt/env2"

What are you seeing

Error: Unknown function: 'fact'.

What behaviour did you expect instead

Puppet run to complete and create virtualenv appropriately.

Output log

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Unknown function: 'fact'. ( .... python/manifests/install.pp, line: 269, column: 14) on node xxxx

Log to entirely verbatim.

Any additional information you'd like to impart

This is the line of code it fails on:

if fact('lsbdistcodename') == 'trusty' {

kenyon commented 3 years ago

The fact function comes from the puppetlabs/stdlib module: https://forge.puppet.com/puppetlabs/stdlib/reference#fact

Do you have puppetlabs/stdlib installed?

n1md4 commented 3 years ago

Hi, kenyon. It was a problem with stdlib, an older crusty version was installed locally that got in the way of pulling the new one in.