The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #1387

parseonly fails when using custom types

Added by Peter Meier almost 6 years ago. Updated almost 2 years ago.

Status:AcceptedStart date:07/01/2008
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:newfeature
Target version:-
Affected Puppet version:0.24.4 Branch:
Keywords:parseonly, custom types

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

If I have cutom types, like the mysql type from DavidS and use them in manifests, the manifests will fail with the parseonly option.

It seems obvious that puppet can’t know anything from your own types and therefor the type is unknown to it. However if you’d like to use parseonly as a sytax checker, this behaviour is obviously not that cool. On the otherside for a complete syntax check parseonly should fail on unknown types.

Maybe this problem could be “solved” by adding a —ignoreunknowntypes option to the —parseonly option, like the —ignoreimports option. A better, but I think more complicated, solution would be to have an additional option to pass additional (module) directories to the —parseonly option, where the custom types can be looked up.

We’d like to use the parseonly option for syntax checking while checking in, however as we use custom types we can’t currently use it.

History

#1 Updated by James Turnbull almost 6 years ago

  • Category set to newfeature
  • Status changed from Unreviewed to Needs More Information

Can you provide some logs for reference. Thanks

#2 Updated by James Turnbull almost 6 years ago

  • Status changed from Needs More Information to Accepted

puppet —parseonly —debug —trace manifests/munin.pp 06:19:33 < duritong> err: Could not parse for environment development: Unknown function

                 mysql_password at 
                 /home/mh/immerda/git/puppet/modules/mysql/manifests/munin.pp:9

#3 Updated by Peter Meier almost 6 years ago

a way to reproduce it:

$ git clone git://github.com/duritong/puppet-mysql.git
$ cd puppet-mysql/
$ puppet --parseonly --trace manifests/munin.pp
err: Could not parse for environment development: Unknown function mysql_password at /tmp/puppet-mysql/manifests/munin.pp:9

mysql_password is defined as a custom function. However it will also fail with custom types.

#4 Updated by Kelsey Hightower almost 2 years ago

  • Description updated (diff)

Ok, so better late than never :)

The ablility to validate manifests using custom types seems to be fixed in atleast Puppet 2.7.x:

$ git clone git://github.com/duritong/puppet-mysql.git
$ cd puppet-mysql/
$ puppet parser validate manifests/server/munin/default.pp

Also available in: Atom PDF