My ENC won't work, YAML is valid AFAIK

90 views
Skip to first unread message

jblaine

unread,
Jan 25, 2012, 11:15:48 PM1/25/12
to puppet...@googlegroups.com
If anyone has any ideas, please share.  I'm at a loss.

YAML from Puppet Enterprise 2.0.0 default ENC:

++++++++++++++++++++++++++++++++
---
name: rcf-cm-master.our.org
parameters: {}

classes:
- core-permissions
++++++++++++++++++++++++++++++++

YAML from my Python ENC using PyYAML.  This results in 'cannot find node'.

++++++++++++++++++++++++++++++++
---
classes:
- core-permissions
name: rcf-cm-master.our.org
parameters: {}
++++++++++++++++++++++++++++++++

Note that putting the YAML output above in a file and loading it with Ruby's
YAML::load does not throw an exception.

I'm stumped :|

Daniel Pittman

unread,
Jan 25, 2012, 11:32:47 PM1/25/12
to puppet...@googlegroups.com

Both of those produce exactly the same content when loaded with the
default Ruby YAML parser, which should be how we load that stuff, and
everything works from my local testing too. :/

Can you dig deeper into what is going on inside your script? Perhaps
something else is going wrong?

>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/VChRtFes9wEJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

--
Daniel Pittman
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

Nigel Kersten

unread,
Jan 25, 2012, 11:46:23 PM1/25/12
to puppet...@googlegroups.com
When you run your script by hand, does it exit 0 ?

Does it do so when the user you are running the master as (pe-puppet I believe in this case) runs the script?



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VChRtFes9wEJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.



--
Nigel Kersten
Product Manager, Puppet Labs


jblaine

unread,
Jan 26, 2012, 1:19:25 AM1/26/12
to puppet...@googlegroups.com
Yes, the code outputs nothing and calls sys.exit(1) if the host cannot be
found in our database.  Running as pe-puppet, which the stock ENC runs
as from what I can tell, it runs fine and $? is 0.

[ 5 minutes later ]

Oh jeez.

I was misreading the red "Log" info for it, assuming it was the same
old "could not find node" from earlier when I had a problem that I
had eventually fixed.

It is now saying "could not find class bedford", which I fully expect at this
stage.

Thank you both for looking into this with me, and sorry to waste anyone's
time.

IDEA: Allow for a special YAML document to be spit out by custom ENCs
when error conditions in the ENC are hit.  It would contain information that
can be shown in the console/reports ?

Daniel Pittman

unread,
Jan 26, 2012, 1:22:39 AM1/26/12
to puppet...@googlegroups.com
On Wed, Jan 25, 2012 at 17:19, jblaine <cjbl...@gmail.com> wrote:

> IDEA: Allow for a special YAML document to be spit out by custom ENCs
> when error conditions in the ENC are hit.  It would contain information that
> can be shown in the console/reports ?

Sounds good. I am happy to look at extending the exec ENC protocol to
support that. I would take a patch, but if you just want to file a
feature request we will look to this when we next touch that protocol.
(Which is probably not that far off, for unrelated reasons.)

Reply all
Reply to author
Forward
0 new messages