Issue #11524 has been updated by Henrik Lindberg.
Status changed from Accepted to Rejected
Looked at this again, and this is a tricky problem to solve since bare words
are function calls, and it is not possible to now by just validating if there
are going to be any functions having the used names.
i.e. the example above is interpreted like this:
<pre>
class ittools {
jkhsdkjhfsd()
hjksdfjk()
dsjkfhdjkshf()
lkj()
package { ['nmap', 'collectl', 'ruby-devel.x86_64',
'rpm-build', 'rubygem-fpm', 'subversion' ]:
ensure => latest
}
}
</pre>
To correctly validate a manifest, a full environment (all modules and
extensions, gems etc.) are required. That is not what puppet validate was
designed to do (quickly check syntax).
Recommend using a tool such as Geppetto since it both validates and *links*
functions, classes, defines, etc.
Closing this issue as rejected.
----------------------------------------
Bug #11524: Random bare words are not caught as errors by puppet validate
https://projects.puppetlabs.com/issues/11524#change-98539
* Author: Bill Weiss
* Status: Rejected
* Priority: Normal
* Assignee:
* Category: parser
* Target version:
* Affected Puppet version: 2.7.8
* Keywords:
* Branch:
----------------------------------------
I totally believe this is valid syntax, but I don't expect it to be :)
Thoughts?
<pre>
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ cat manifests/init.pp
class ittools {
jkhsdkjhfsd
hjksdfjk
dsjkfhdjkshf
lkj
package { ['nmap', 'collectl', 'ruby-devel.x86_64',
'rpm-build', 'rubygem-fpm', 'subversion' ]:
ensure => latest
}
}
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ puppet --version
2.7.9
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ puppet parser validate
manifests/init.pp
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ echo $?
0
</pre>
However, a more normal syntax error would be caught:
<pre>
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ cat manifests/init.pp
class ittools {
package { ['nmap', 'collectl', 'ruby-devel.x86_64',
'rpm-build', 'rubygem-fpm', 'subversion' ]:
ensure => latest'
}
}
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ puppet parser validate !$
puppet parser validate manifests/init.pp
err: Could not parse for environment production: Unclosed quote after '' in '
}
}
' at /home/bweiss/repos/puppet/modules/ittools/manifests/init.pp:4
err: Try 'puppet help parser validate' for usage
bweiss@rezal-evad-gib:~/repos/puppet/modules/ittools$ echo $?
1
</pre>
This was also the case in 2.7.8, if that matters.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.