Feature #2896

`puppet parser validate` does not check resource parameters

Added by Dan Bode about 2 years ago. Updated 9 days ago.

Status:Accepted Start date:12/07/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:parser
Target version:2.7.x
Affected Puppet version:0.25.1 Branch:
Keywords:
Votes: 1

Description

puppet --parseonly does not show an error when parsing:

file{'name': bad_owner => 'invalid'}

This should also work for resource definitions.

my_def($param_a='_UNSET_') {} 

my_def{ 
  'my_def_1': 
  pram_a => 'foo'; 
} 

Related issues

duplicated by Puppet - Bug #3515: parseonly failure on user attribute Duplicate 04/07/2010

History

Updated by James Turnbull about 2 years ago

  • Category set to parser
  • Status changed from Unreviewed to Accepted

Updated by Luke Kanies almost 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Assignee set to Dan Bode

Dan – I think this actually already works this way in the current testing branch, because of the changes I made to the AST classes.

Once Markus gets a new branch pushed, can you test this?

Updated by Markus Roberts almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Investigating

Updated by James Turnbull over 1 year ago

  • Status changed from Investigating to In Topic Branch Pending Review

Updated by Dan Bode over 1 year ago

it did not pass the tests that are listed in the ticket.

Updated by Markus Roberts over 1 year ago

  • Status changed from In Topic Branch Pending Review to Investigating

Updated by Markus Roberts over 1 year ago

  • Target version changed from 2.6.0 to 52

Updated by Dan Bode over 1 year ago

  • Assignee deleted (Dan Bode)

Updated by James Turnbull about 1 year ago

  • Assignee set to Nigel Kersten
  • Target version changed from 52 to 2.7.x

Nigel –

Updated by Nigel Kersten about 1 year ago

  • Status changed from Investigating to Accepted
  • Assignee deleted (Nigel Kersten)

Updated by Daniel Pittman 5 months ago

  • Subject changed from --parseonly does not check resource parameters to `puppet parser validate` does not check resource parameters
  • Description updated (diff)

The specific functionality, --parseonly, has been deprecated in favour of puppet parser validate, but the underlying issue remains.

The actual challenge is that we really need almost an entire parser run to achieve the second half (defined types), and for the user to supply all the data the compiler would have.

Just doing parameter checking for known types would almost be easy, except that same issue applies when custom types and providers come on the scene.

Updated by Clay Caviness 9 days ago

“puppet parser validate” has reallllly limited functionality as it stands, only really catching missing commas or mismatched braces.

Even obvious errors like file { '/tmp/foo': ensrue => file, } pass the parser, not to mention things like apricot { "carburetor": freeble => "munchkin", }

Updated by Daniel Pittman 9 days ago

  • Description updated (diff)

Also available in: Atom PDF