On 07/23/2009 10:44 AM, James Cammarata wrote:
> Reading the puppet documentation on external nodes
> (http://reductivelabs.com/trac/puppet/wiki/ExternalNodes), it says the
> external node script should return output in YAML format. However, the
> cobbler-ext-nodes script is just returning what is returned by the web url
> (http://cobbler/cblr/svc/op/puppet/hostname/foo):
>
> # /usr/bin/cobbler-ext-nodes system.mydomain.com
> classes: [test1, test2]
> parameters: {from_cobbler: 1, tree:
> 'http://@@http_server@@/cblr/links/rhel5.1-xen-x86_64'}
>
> So, is the external node script broken, or is cobblerd not returning the
> correct output?
>
>
That's valid YAML. YAML can sometimes go into "flow-layout" mode, and
that's legal. Here's a quick test program:
import yaml
classes = [1,2]
params = [3,4]
newdata = {
"classes" : classes,
"parameters" : params
}
str = yaml.dump(newdata)
print str
print yaml.load(str)
===================================
[mdeh...@mdehaan cobbler]$ python /tmp/test.py
classes: [1, 2]
parameters: [3, 4]
{'classes': [1, 2], 'parameters': [3, 4]}
===================================
Is Puppet choking on this? Our YAML library has options to prevent this
if needed.
--Michael
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler