On Thu, 23 Jul 2009 10:54:12 -0400, Michael DeHaan <[email protected]>
wrote:
> 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

I haven't really tested it out yet, just curious since the external nodes
script isn't doing anything with the YAML module, just this:

       url = "http://%s/cblr/svc/op/puppet/hostname/%s"; % (server,
hostname)
       print urlgrabber.urlread(url)

It does look like cobblerd is doing a yaml conversion though (from
services.py puppet()):

   return yaml.dump(newdata)

So I guess all is well :)

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to