Issue #13902 has been updated by Stefan Schulte.
Status changed from Unreviewed to Needs More Information
Assignee set to Eslam El Husseiny
Well you have not posted very much of your manifest and the snippet you
provided does work as expected
<pre>
# cat /tmp/apply
if defined( Exec['run the shell server'] ){
notify { 'test':
message => 'It is indeed defined',
}
}
# puppet apply /tmp/apply.pp
notice: Finished catalog run in 0.08 seconds
</pre>
So I guess there might be something wrong above your `if` statement?
Also be aware that this might not work as expected because the defined function
is order dependent and if the parser sees your call to `defined` before it sees
your `exec` resource the function will always evaluate to `false`. Make sure to
read [http://docs.puppetlabs.com/references/stable/function.html#defined]
before using `defined`.
----------------------------------------
Bug #13902: defined() function problem
https://projects.puppetlabs.com/issues/13902#change-60415
Author: Eslam El Husseiny
Status: Needs More Information
Priority: Normal
Assignee: Eslam El Husseiny
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
hi,
i was trying to use defined function with if condition and i got this error :
" Syntax error at 'if'; expected '}' at /path_to_manifest.pp:30 "
line 30 :
if defined( Exec['run the shell server'] ){
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.