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

Bug #8096

Shouldn't be able to declare both "name" and namevar for types that have namevars

Added by Nick Fagerlund about 3 years ago. Updated almost 3 years ago.

Status:AcceptedStart date:06/24/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:3.x
Affected Puppet version: Branch:
Keywords:

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

These both work:

file {'myfile':
  ensure => file,
  content => "hi there",
  path => "/tmp/pathfile",
  name => "/tmp/namefile",
}

exec {'myexec':
  logoutput => true,
  command => '/opt/local/bin/cowsay "from command"',
  name => '/opt/local/bin/cowsay "from name"',
}

Luke informed us that this used to throw an exception, though I haven’t tested to find out which versions that applies to.

Nigel and I think “name” just shouldn’t be allowed if there’s a declared namevar like “path;” it’s not introspectible, and amounts to a secret backdoor that leads to illegible Puppet code. Luke said he doesn’t have a philosophical problem with doing that, but he believes we should do a real deprecation instead of silently fixing it, since it’s a change in behavior that might cause some unknown amount of havoc out in the wild.


Related issues

Related to Puppet - Bug #8079: Metaparameter 'name' is not documented Closed 06/24/2011

History

#1 Updated by Nick Fagerlund about 3 years ago

Also, spoiler alert, “name” always wins out over the namevar in the examples above.

#2 Updated by Henrik Lindberg about 3 years ago

Is ‘name’ valid if no other namevar has been declared? Or, does that mean that the type is not name-able… ?

#3 Updated by Nick Fagerlund about 3 years ago

If no other namevar has been declared, “name” IS the namevar. (I realize I’m replying to you twice! I just want to make sure context is findable from both places.)

#4 Updated by Nigel Kersten almost 3 years ago

  • Target version set to 3.x

Also available in: Atom PDF