#NEWLINE# def dump_environment_config( self , environment_name , output_directory ) : #NEWLINE# #INDENT# expanded_configuration = self . get_environment_config ( resources ) #NEWLINE# if os . path . exists ( output_directory ) : #NEWLINE# #INDENT# shutil . rmtree ( output_directory ) #NEWLINE# #UNINDENT# mkdir_p ( output_directory ) #NEWLINE# for ( resource_type , resources ) in expanded_configuration . items ( ) : #NEWLINE# #INDENT# resource_type_dir = os . path . join ( output_directory , resource_type ) #NEWLINE# mkdir_p ( resource_type_dir ) #NEWLINE# for ( unique_id , resource_config ) in resources . items ( ) : #NEWLINE# #INDENT# resource_file = os . path . join ( resource_type_dir , ( '%s.json' % unique_id ) ) #NEWLINE# with open ( resource_file , 'w' ) as fp : #NEWLINE# #INDENT# json . dump ( resource_config , fp , indent = 4 )