#NEWLINE# def data( TEST ) : #NEWLINE# #INDENT# TEST . stacks = utils . TestDataContainer ( ) #NEWLINE# TEST . stack_templates = utils . TestDataContainer ( ) #NEWLINE# TEST . stack_environments = utils . TestDataContainer ( ) #NEWLINE# TEST . stack_snapshot_create = utils . TestDataContainer ( ) #NEWLINE# TEST . stack_snapshot = utils . TestDataContainer ( ) #NEWLINE# TEST . resource_types = utils . TestDataContainer ( ) #NEWLINE# TEST . heat_resources = utils . TestDataContainer ( ) #NEWLINE# TEST . heat_services = utils . TestDataContainer ( ) #NEWLINE# TEST . template_versions = utils . TestDataContainer ( ) #NEWLINE# TEST . template_functions = utils . TestDataContainer ( ) #NEWLINE# service_1 = services . Service ( services . ServiceManager ( None ) , { #NEWLINE# #INDENT# 'status' : 'up' , #NEWLINE# 'binary' : 'heat-engine' , #NEWLINE# 'report_interval' : 60 , #NEWLINE# 'engine_id' : '2f7b5a9b-c50b-4b01-8248-f89f5fb338d1' , #NEWLINE# 'created_at' : '2015-02-06T03:23:32.000000' , #NEWLINE# 'hostname' : 'mrkanag' , #NEWLINE# 'updated_at' : '2015-02-20T09:49:52.000000' , #NEWLINE# 'topic' : 'engine' , #NEWLINE# 'host' : 'engine-1' , #NEWLINE# 'deleted_at' : None , #NEWLINE# 'id' : '1efd7015-5016-4caa-b5c8-12438af7b100' , #NEWLINE# #UNINDENT# } ) #NEWLINE# service_2 = services . Service ( services . ServiceManager ( None ) , { #NEWLINE# #INDENT# 'status' : 'up' , #NEWLINE# 'binary' : 'heat-engine' , #NEWLINE# 'report_interval' : 60 , #NEWLINE# 'engine_id' : '2f7b5a9b-c50b-4b01-8248-f89f5fb338d2' , #NEWLINE# 'created_at' : '2015-02-06T03:23:32.000000' , #NEWLINE# 'hostname' : 'mrkanag' , #NEWLINE# 'updated_at' : '2015-02-20T09:49:52.000000' , #NEWLINE# 'topic' : 'engine' , #NEWLINE# 'host' : 'engine-2' , #NEWLINE# 'deleted_at' : None , #NEWLINE# 'id' : '1efd7015-5016-4caa-b5c8-12438af7b100' , #NEWLINE# #UNINDENT# } ) #NEWLINE# TEST . heat_services . add ( service_1 ) #NEWLINE# TEST . heat_services . add ( service_2 ) #NEWLINE# TEST . api_resource_types = utils . TestDataContainer ( ) #NEWLINE# for i in range ( 10 ) : #NEWLINE# #INDENT# stack_data = { #NEWLINE# #INDENT# 'description' : 'No description' , #NEWLINE# 'links' : [ { #NEWLINE# #INDENT# 'href' : 'http://192.168.1.70:8004/v1/051c727ee67040d6a7b7812708485a97/stacks/stack-test{0}/05b4f39f-ea96-4d91-910c-e758c078a089{0}' . format ( i ) , #NEWLINE# 'rel' : 'self' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'parameters' : { #NEWLINE# #INDENT# 'DBUsername' : '******' , #NEWLINE# 'InstanceType' : 'm1.small' , #NEWLINE# 'AWS::StackId' : 'arn:openstack:heat::2ce287:stacks/teststack/88553ec' , #NEWLINE# 'DBRootPassword' : '******' , #NEWLINE# 'AWS::StackName' : 'teststack{0}' . format ( i ) , #NEWLINE# 'DBPassword' : '******' , #NEWLINE# 'AWS::Region' : 'ap-southeast-1' , #NEWLINE# 'DBName' : 'wordpress' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'stack_status_reason' : 'Stack successfully created' , #NEWLINE# 'stack_name' : 'stack-test{0}' . format ( i ) , #NEWLINE# 'creation_time' : '2013-04-22T00:11:39Z' , #NEWLINE# 'updated_time' : '2013-04-22T00:11:39Z' , #NEWLINE# 'stack_status' : 'CREATE_COMPLETE' , #NEWLINE# 'id' : '05b4f39f-ea96-4d91-910c-e758c078a089{0}' . format ( i ) , #NEWLINE# #UNINDENT# } #NEWLINE# stack = stacks . Stack ( stacks . StackManager ( None ) , stack_data ) #NEWLINE# TEST . stacks . add ( stack ) #NEWLINE# #UNINDENT# for i in range ( 10 ) : #NEWLINE# #INDENT# snapshot_data = { #NEWLINE# #INDENT# 'status' : 'COMPLETE' , #NEWLINE# 'name' : 'null' , #NEWLINE# 'data' : { #NEWLINE# #INDENT# 'files' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'status' : 'COMPLETE' , #NEWLINE# 'name' : 'zhao3' , #NEWLINE# 'tags' : [ 'a' , ' 123' , ' b' , ' 456' ] , #NEWLINE# 'stack_user_project_id' : '3cba4460875444049a2a7cc5420ccddb' , #NEWLINE# 'environment' : { #NEWLINE# #INDENT# 'encrypted_param_names' : [ ] , #NEWLINE# 'parameter_defaults' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'event_sinks' : [ ] , #NEWLINE# 'parameters' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'resource_registry' : { #NEWLINE# #INDENT# 'resources' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'template' : { #NEWLINE# #INDENT# 'heat_template_version' : '2013-05-23' , #NEWLINE# 'description' : 'HOT template for Test.' , #NEWLINE# 'resources' : { #NEWLINE# #INDENT# 'private_subnet' : { #NEWLINE# #INDENT# 'type' : 'OS::Neutron::Subnet' , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'network_id' : { #NEWLINE# #INDENT# 'get_resource' : 'private_net' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'cidr' : '172.16.2.0/24' , #NEWLINE# 'gateway_ip' : '172.16.2.1' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'private_net' : { #NEWLINE# #INDENT# 'type' : 'OS::Neutron::Net' , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'name' : 'private-net' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'action' : 'SNAPSHOT' , #NEWLINE# 'project_id' : '1acd0026829f4d28bb2eff912d7aad0d' , #NEWLINE# 'id' : '70650725-bdbd-419f-b53f-5707767bfe0e' , #NEWLINE# 'resources' : { #NEWLINE# #INDENT# 'private_subnet' : { #NEWLINE# #INDENT# 'status' : 'COMPLETE' , #NEWLINE# 'name' : 'private_subnet' , #NEWLINE# 'resource_data' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'resource_id' : '9c7211b3-31c7-41f6-b92a-442ad3f71ef0' , #NEWLINE# 'action' : 'SNAPSHOT' , #NEWLINE# 'type' : 'OS::Neutron::Subnet' , #NEWLINE# 'metadata' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'private_net' : { #NEWLINE# #INDENT# 'status' : 'COMPLETE' , #NEWLINE# 'name' : 'private_net' , #NEWLINE# 'resource_data' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'resource_id' : 'ff4fd287-31b2-4d00-bc96-c409bc1db027' , #NEWLINE# 'action' : 'SNAPSHOT' , #NEWLINE# 'type' : 'OS::Neutron::Net' , #NEWLINE# 'metadata' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'creation_time' : '2016-02-21T04:02:54' , #NEWLINE# 'status_reason' : 'Stack SNAPSHOT completed successfully' , #NEWLINE# 'id' : '01558a3b-ba05-4427-bbb4-1e4ab71cfcad' , #NEWLINE# #UNINDENT# } #NEWLINE# TEST . stack_snapshot . add ( snapshot_data ) #NEWLINE# #UNINDENT# TEST . stack_templates . add ( Template ( TEMPLATE , VALIDATE ) ) #NEWLINE# TEST . stack_environments . add ( Environment ( ENVIRONMENT ) ) #NEWLINE# TEST . stack_snapshot_create . add ( Snapshot ( SNAPSHOT_CREATE ) ) #NEWLINE# r_type_1 = { #NEWLINE# #INDENT# 'resource_type' : 'AWS::CloudFormation::Stack' , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'Parameters' : { #NEWLINE# #INDENT# 'description' : 'The set of parameters passed to this nested stack.' , #NEWLINE# 'immutable' : False , #NEWLINE# 'required' : False , #NEWLINE# 'type' : 'map' , #NEWLINE# 'update_allowed' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'TemplateURL' : { #NEWLINE# #INDENT# 'description' : 'The URL of a template that specifies the stack to be created as a resource.' , #NEWLINE# 'immutable' : False , #NEWLINE# 'required' : True , #NEWLINE# 'type' : 'string' , #NEWLINE# 'update_allowed' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'TimeoutInMinutes' : { #NEWLINE# #INDENT# 'description' : 'The length of time, in minutes, to wait for the nested stack creation.' , #NEWLINE# 'immutable' : False , #NEWLINE# 'required' : False , #NEWLINE# 'type' : 'number' , #NEWLINE# 'update_allowed' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# r_type_2 = { #NEWLINE# #INDENT# 'resource_type' : 'OS::Heat::CloudConfig' , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# 'config' : { #NEWLINE# #INDENT# 'description' : 'The config value of the software config.' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'cloud_config' : { #NEWLINE# #INDENT# 'description' : 'Map representing the cloud-config data structure which will be formatted as YAML.' , #NEWLINE# 'immutable' : False , #NEWLINE# 'required' : False , #NEWLINE# 'type' : 'map' , #NEWLINE# 'update_allowed' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# r_types_list = [ r_types_list , r_type_2 ] #NEWLINE# for rt in r_types_list : #NEWLINE# #INDENT# r_type = resource_types . ResourceType ( resource_types . ResourceTypeManager ( None ) , rt [ 'resource_type' ] ) #NEWLINE# TEST . resource_types . add ( r_type ) #NEWLINE# TEST . api_resource_types . add ( rt ) #NEWLINE# #UNINDENT# resource_1 = resources . Resource ( resources . ResourceManager ( None ) , { #NEWLINE# #INDENT# 'logical_resource_id' : 'my_resource' , #NEWLINE# 'physical_resource_id' : '7b5e29b1-c94d-402d-b69c-df9ac6dfc0ce' , #NEWLINE# 'resource_name' : 'my_resource' , #NEWLINE# 'links' : [ { #NEWLINE# #INDENT# 'href' : ( 'http://192.168.1.70:8004/v1/051c727ee67040d6a7b7812708485a97/stacks/%s/%s/resources/my_resource' % ( TEST . stacks . first ( ) . stack_name , TEST . stacks . first ( ) . id ) ) , #NEWLINE# 'rel' : 'self' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'href' : ( 'http://192.168.1.70:8004/v1/051c727ee67040d6a7b7812708485a97/stacks/%s/%s' % ( TEST . stacks . first ( ) . stack_name , TEST . stacks . first ( ) . id ) ) , #NEWLINE# 'rel' : 'stack' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# 'metadata' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# TEST . heat_resources . add ( resource_1 ) #NEWLINE# template_version_1 = template_versions . TemplateVersion ( template_versions . TemplateVersionManager ( None ) , { #NEWLINE# #INDENT# 'version' : 'HeatTemplateFormatVersion.2012-12-12' , #NEWLINE# 'type' : 'cfn' , #NEWLINE# #UNINDENT# } ) #NEWLINE# template_version_2 = template_versions . TemplateVersion ( template_versions . TemplateVersionManager ( None ) , { #NEWLINE# #INDENT# 'version' : 'heat_template_version.2013-05-23' , #NEWLINE# 'type' : 'hot' , #NEWLINE# #UNINDENT# } ) #NEWLINE# TEST . template_versions . add ( template_version_1 ) #NEWLINE# TEST . template_versions . add ( template_version_2 ) #NEWLINE# template_function_1 = template_versions . TemplateVersion ( template_versions . TemplateVersionManager ( None ) , { #NEWLINE# #INDENT# 'functions' : 'Fn::GetAZs' , #NEWLINE# 'description' : 'A function for retrieving the availability zones.' , #NEWLINE# #UNINDENT# } ) #NEWLINE# template_function_2 = template_versions . TemplateVersion ( template_versions . TemplateVersionManager ( None ) , { #NEWLINE# #INDENT# 'functions' : 'Fn::Join' , #NEWLINE# 'description' : 'A function for joining strings.' , #NEWLINE# #UNINDENT# } ) #NEWLINE# TEST . template_functions . add ( template_function_1 ) #NEWLINE# TEST . template_functions . add ( template_function_2 )