importing troposphere causes yaml.load to output OrderedDict.
I installed troposphere from the git master (3a3004a183fd0d70e57b9c9d1b92763b2962d09e) and yaml.load behavior changed: Here's a test script:
#!/usr/bin/env python3
from pprint import pprint
import yaml
from troposphere import Template
yaml_string = '''
base:
- name: everyone
ips: [ 0.0.0.0/0 ]
'''
config = yaml.load(yaml_string)
pprint(config)
It shows "base" as a list of OrderedDict. If I run off of 1.9.4 it's just a list of a dict.
The cfn_flip module is the one causing this.
I've opened an issue: https://github.com/awslabs/aws-cfn-template-flip/issues/14
Thanks for the issue and adding the cfn_flip issue as well.
@jeffreyctang I haven't seen any comments yet in the aws-cfn-template-flip issue. While I understand this is a change in behavior for your existing yaml uses I'd like to understand the impact of keeping the yaml changes (cfn_flip) in the code vs. pulling it or rewriting it.
I've got 6k lines of yaml configuration for building our AWS assets using troposphere.
I imagine there's some way of isolating the aws-template-flip yaml settings from mine. I'm no python expert amd the 10 minutes I spent on it yielded no solutions.
If this was included in a release, I would be forced to either
- figure out the yaml isolation, which I'm not confident I can do or is reasonably possible.
- postprocess my yaml.load output and convert all the OrderedDicts, which I'm confident I can manage.
I could live with it and I am waiting for the next release for a couple of items.
That said, I would imagine many other users of troposphere are loading yaml in some capacity or another and this would break things for them. It's a disconcerting error and not at all obvious that it's related to troposphere.
Fixed in cfn_flip now :)
@stilvoid thank you for making the change. @jeffreyctang can you verify from your side and then we can close this out?
Confirmed. The new cfn_flip modules doesn't affect my yaml parsing.
Thanks! Closing due to upstream fix.