I'm trying to only print the following:
   grains:
       roles:
         - webserver
         - php
       environment: X

Not the entire document.

I still haven't figured out how to print a part of the document only.

On Tue, Oct 23, 2012 at 7:09 PM, Kirill Simonov <xi@resolvent.net> wrote:
The output looks correct to me.  What output do you expect?

Thanks,
Kirill


On 10/23/2012 03:45 PM, Zippy Zeppoli wrote:
Hi list,
I am using the PyYAML implementation for yaml (They don't have their own
mailing list, so I'm bringing this question here. I hope some folks are
familiar with it and can assist.

I have the following yaml doc:
---
instance:
      id: i-1234567
      saltId: APPSRV-X
      grains:
        roles:
          - webserver
          - php
        environment: X

I then try to dump it from one file to another, there are multiple yaml
docs in this file, and I am picking one doc and copying it to another
file basically.

Here is the code I used to do it:
https://gist.github.com/3941410

This is the resulting output:

id: APPSRV-X
environment: X
roles: [webserver, php]

For some reason it doesn't maintain it's structure, and I cannot figure
out how to keep it.

I tried changing the line with
             yaml.dump(configDict['instance']['grains'], TEST_CONFIG_FILE)


to
             yaml.dump(configDict['instance']['id'], TEST_CONFIG_FILE)


and the output get's even stranger:
id: APPSRV-X
i-1234567
...

any help is appreciated.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct



_______________________________________________
Yaml-core mailing list
Yaml-core@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yaml-core