def convert_json_to_yaml(json_str):
 tpl = jsonutils.loads(json_str, object_pairs_hook=collections.OrderedDict)
 def top_level_items(tpl):
  (yield ('HeatTemplateFormatVersion', '2012-12-12'))
  for (k, v) in six.iteritems(tpl):
   if (k != 'AWSTemplateFormatVersion'):
    (yield (k, v))
 return yaml.dump(collections.OrderedDict(top_level_items(tpl)), Dumper=yaml_dumper)

def convert_json_to_yaml ( json_str ) : tpl = jsonutils . loads ( json_str , object_pairs_hook = collections . OrderedDict ) def top_level_items ( tpl ) : ( yield ( 'HeatTemplateFormatVersion' , '2012-12-12' ) ) for ( k , v ) in six . iteritems ( tpl ) : if ( k != 'AWSTemplateFormatVersion' ) : ( yield ( k , v ) ) return yaml . dump ( collections . OrderedDict ( top_level_items ( tpl ) ) , Dumper = yaml_dumper )
convert aws json template format to heat yaml format .