Puppet: System Administration Automated

Support

Ticket #548 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

defined function cannot accept resource references as arguments

Reported by: windowsrefund Assigned to: luke
Priority: normal Milestone: fozzie
Component: library Version: 0.22.1
Severity: normal Keywords: define function bug
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Medium

Description

$refcheck = defined(File/home/$name/.ssh?) if $refcheck {} else {

file { "/home/${name}/.ssh":

ensure => directory, owner => $name, group => $name, mode => 700

}

}

puppetd says: err: Syntax error at 'File' at /etc/puppet.testing/manifests/lib/ssh-keygen.pp:22

Change History

03/28/07 07:46:20 changed by luke

  • status changed from new to assigned.

It turns out the documentation of this function is incorrect -- it's currently not syntactically legal to specify a resource reference as an argument to an rvalue-function like 'defined'. The docs have been corrected in [2358], but I don't know when I'll get around to fixing the reality.

04/05/07 22:54:42 changed by luke

  • specification set to Unnecessary.
  • patch set to None.
  • complexity set to Medium.
  • milestone set to elmo.
  • approval set to Unnecessary.
  • compatibility set to Unknown.
  • stage set to Accepted.

04/30/07 21:27:34 changed by luke

  • summary changed from defined function is not working to defined function cannot accept resource references as arguments.

06/08/07 20:32:26 changed by luke

  • milestone changed from elmo to fozzie.

06/18/07 08:27:27 changed by luke

Fixed in [2599].

06/18/07 08:28:00 changed by luke

  • status changed from assigned to closed.
  • resolution set to fixed.