Geppetto 4.3.1: Unknown function: scanf

60 views
Skip to first unread message

Jim Perry

unread,
Jul 26, 2016, 10:15:30 AM7/26/16
to Puppet Geppetto
I am in the process of porting the existing puppet 0.25 to Puppet 3.8.7 running under Foreman.  When I was writing a module to handle getting the correct OS major version from older OS, that I needed to use scanf against operatingsystemrelease and lsbdistrelease for systems where the latest Factor version wasn't providing the operatingsystemmajrelease or lsbmajdistrelease values. 

So I have an example like: 

  $myrelease = scanf($lsbdistrelease, "%d")

Puppet is find with that function, but Geppetto is giving me Unknown function: 'scanf'.   

I did some RTFM via Google and didn't find any references to correcting any unknown function errors for valid Puppet functions in 3.8 or 4.x. When I click on it I get options to change it to something like sprintf, but sprintf is not getting the required value and I am no Ruby sprintf guru to get it to disregard everything to the right of the . in the 7.2.1511 CentOS 7 has in operatingsystemrelease. Plus the scanf call works perfectly to do it as I need. 

Can anyone enlighten me on how to give Geppetto an updated function list or does this need to be added to the next patch to Geppetto? 

Henrik Lindberg

unread,
Jul 26, 2016, 10:20:17 AM7/26/16
to puppet-...@googlegroups.com
You can look here:
http://puppetlabs.github.io/geppetto/faq.html#/2011/11/01/how-do-i-add-global-variables for how that is done for variables. Glean at the other files there to see how the same is done for functions.

Alternatively add a fake function with the same name in a module.

- henrik

--
You received this message because you are subscribed to the Google Groups "Puppet Geppetto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-geppet...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Perry

unread,
Jul 27, 2016, 12:36:15 PM7/27/16
to Puppet Geppetto
Thanks. That got be what I was I needed.  A quick add removed the error for the valid function. 
Reply all
Reply to author
Forward
0 new messages