Add ip output in compute translation 13/22313/2
authorshangxdy <shang.xiaodong@zte.com.cn>
Thu, 22 Sep 2016 07:38:17 +0000 (15:38 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Fri, 23 Sep 2016 03:25:25 +0000 (11:25 +0800)
As a template designer,
I want to visit a server which is depleted by parser,
So it's necessary to make the ip exposed.

JIRA:PARSER-109

Change-Id: Idef0605d23df6af38b86e7a393a151b34828e511
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
21 files changed:
tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py
tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/hot_vRNC.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml
tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml

index c02a547..12ea355 100644 (file)
@@ -33,12 +33,12 @@ class ToscaTemplateOutputTest(TestCase):
                             'server, http://<IP>:3000',
                             'value':
                             {'get_attr':
-                             ['app_server', 'networks']}},
+                             ['app_server', 'first_address']}},
                            'mongodb_url':
                            {'description': 'URL for the mongodb server.',
                             'value':
                             {'get_attr':
-                             ['mongo_server', 'networks']}}}
+                             ['mongo_server', 'first_address']}}}
 
         hot_translation_dict = \
             toscaparser.utils.yamlparser.simple_parse(hot_translation)
index 8a959d1..b685d6a 100644 (file)
@@ -324,7 +324,7 @@ class ToscaCompute(HotResource):
                   attriute.'))
         if attribute == 'private_address' or \
            attribute == 'public_address':
-                attr['get_attr'] = [self.name, 'networks']
+                attr['get_attr'] = [self.name, 'first_address']
 
         return attr
 
index debbcf7..7d0a038 100644 (file)
@@ -52,7 +52,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -111,7 +111,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
       server:
         get_resource: mongo_server
       signal_transport: HEAT_SIGNAL
@@ -189,7 +189,7 @@ resources:
         logstash_ip:
           get_attr:
           - logstash_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -285,7 +285,7 @@ resources:
         logstash_ip:
           get_attr:
           - logstash_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -363,7 +363,7 @@ resources:
         elasticsearch_ip:
           get_attr:
           - elasticsearch_server
-          - networks
+          - first_address
       server:
         get_resource: logstash_server
       signal_transport: HEAT_SIGNAL
@@ -440,11 +440,11 @@ resources:
         elasticsearch_ip:
           get_attr:
           - elasticsearch_server
-          - networks
+          - first_address
         kibana_ip:
           get_attr:
           - kibana_server
-          - networks
+          - first_address
       server:
         get_resource: kibana_server
       signal_transport: HEAT_SIGNAL
@@ -523,32 +523,32 @@ outputs:
     value:
       get_attr:
       - app_server
-      - networks
+      - first_address
 
   mongodb_url:
     description: URL for the mongodb server.
     value:
       get_attr:
       - mongo_server
-      - networks
+      - first_address
 
   logstash_url:
     description: URL for the logstash server.
     value:
       get_attr:
       - logstash_server
-      - networks
+      - first_address
 
   elasticsearch_url:
     description: URL for the elasticsearch server.
     value:
       get_attr:
       - elasticsearch_server
-      - networks
+      - first_address
 
   kibana_url:
     description: URL for the kibana server.
     value:
       get_attr:
       - kibana_server
-      - networks
+      - first_address
index 28ac520..e5df8d2 100644 (file)
@@ -52,7 +52,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
 
       server:
         get_resource: app_server
@@ -112,7 +112,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
 
       server:
         get_resource: mongo_server
@@ -191,7 +191,7 @@ resources:
         logstash_ip:
           get_attr:
           - logstash_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -287,7 +287,7 @@ resources:
         logstash_ip:
           get_attr:
           - logstash_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -365,7 +365,7 @@ resources:
         elasticsearch_ip:
           get_attr:
           - elasticsearch_server
-          - networks
+          - first_address
       server:
         get_resource: logstash_server
       signal_transport: HEAT_SIGNAL
@@ -442,11 +442,11 @@ resources:
         elasticsearch_ip:
           get_attr:
           - elasticsearch_server
-          - networks
+          - first_address
         kibana_ip:
           get_attr:
           - kibana_server
-          - networks
+          - first_address
 
       server:
         get_resource: kibana_server
@@ -526,33 +526,32 @@ outputs:
     value:
       get_attr:
       - app_server
-      - networks
+      - first_address
 
   mongodb_url:
     description: URL for the mongodb server.
     value:
       get_attr:
       - mongo_server
-      - networks
+      - first_address
 
   logstash_url:
     description: URL for the logstash server.
     value:
       get_attr:
       - logstash_server
-      - networks
+      - first_address
 
   elasticsearch_url:
     description: URL for the elasticsearch server.
     value:
       get_attr:
       - elasticsearch_server
-      - networks
+      - first_address
 
   kibana_url:
     description: URL for the kibana server.
     value:
       get_attr:
       - kibana_server
-      - networks
-
+      - first_address
index b3c9a64..8a031e2 100644 (file)
@@ -61,7 +61,7 @@ resources:
         logstash_ip:
           get_attr:
           - logstash_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
index b8de0e0..df35a10 100644 (file)
@@ -46,7 +46,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
       server:
         get_resource: mongo_server
       signal_transport: HEAT_SIGNAL
@@ -122,7 +122,7 @@ resources:
         mongodb_ip:
           get_attr:
           - mongo_server
-          - networks
+          - first_address
       server:
         get_resource: app_server
       signal_transport: HEAT_SIGNAL
@@ -177,10 +177,10 @@ outputs:
     value:
       get_attr:
       - mongo_server
-      - networks
+      - first_address
   nodejs_url:
     description: URL for the nodejs server, http://<IP>:3000
     value:
       get_attr:
       - app_server
-      - networks
+      - first_address
index c669f19..4f9d562 100644 (file)
@@ -491,25 +491,25 @@ outputs:
     value:
       get_attr:
       - MM_Active_Host
-      - networks
+      - first_address
 
   private_ip_of_CM:
     description: The private IP address of the CM.
     value:
       get_attr:
       - CM_Active_Host
-      - networks
+      - first_address
 
   private_ip_of_DM:
     description: The private IP address of the DM.
     value:
       get_attr:
       - DM_Host
-      - networks
+      - first_address
 
   private_ip_of_LB:
     description: The private IP address of the LB.
     value:
       get_attr:
       - LB_Host
-      - networks
+      - first_address
index fe52053..e664124 100644 (file)
@@ -63,7 +63,7 @@ outputs:
     value:
       get_attr:
       - my_server
-      - networks
+      - first_address
   volume_id:
     description: The volume id of the block storage instance.
     value:
index b5724eb..5e1c3eb 100644 (file)
@@ -77,13 +77,13 @@ outputs:
     value:
       get_attr:
       - my_web_app_tier_1
-      - networks
+      - first_address
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
-      - networks
+      - first_address
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 9c1cfbf..487501d 100644 (file)
@@ -77,13 +77,13 @@ outputs:
     value:
       get_attr:
       - my_web_app_tier_1
-      - networks
+      - first_address
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
-      - networks
+      - first_address
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 586edf7..d615a8d 100644 (file)
@@ -81,13 +81,13 @@ outputs:
     value:
       get_attr:
       - my_web_app_tier_1
-      - networks
+      - first_address
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
-      - networks
+      - first_address
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 1bb9059..73a574b 100644 (file)
@@ -81,13 +81,13 @@ outputs:
     value:
       get_attr:
       - my_web_app_tier_1
-      - networks
+      - first_address
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
-      - networks
+      - first_address
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 5d72b01..dc5fad6 100644 (file)
@@ -90,13 +90,13 @@ outputs:
     value:
       get_attr:
       - my_server
-      - networks
+      - first_address
   server_ip_2:
     description: The private IP address of the applications second server.
     value:
       get_attr:
       - my_server2
-      - networks
+      - first_address
   volume_id_1:
     description: The volume id of the first block storage instance.
     value:
index d3dbed6..ec5c61f 100644 (file)
@@ -90,13 +90,13 @@ outputs:
     value:
       get_attr:
       - my_server
-      - networks
+      - first_address
   server_ip_2:
     description: The private IP address of the applications second server.
     value:
       get_attr:
       - my_server2
-      - networks
+      - first_address
   volume_id_1:
     description: The volume id of the first block storage instance.
     value: