Fix network info output about compute node 57/20057/1
authorshangxdy <shang.xiaodong@zte.com.cn>
Wed, 31 Aug 2016 16:27:36 +0000 (00:27 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Wed, 31 Aug 2016 16:27:36 +0000 (00:27 +0800)
In the template version of 2013-05-23, the intrinsic function of
get_attr doesn't support keys or indexes, it requires 2014-10-16 or
higher, the syntax is below:
  get_attr:
    <resource name>
    <attribute name>
    <key/index 1> (optional) not support in 2013-05-23
    <key/index 2> (optional) not support in 2013-05-23

So the translation about compute node's ip address only uses two
parameters currently.

JIRA:PARSER-101

Change-Id: I51e5d7c04c329ede69ff3be61bbee2941b56ea93
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
20 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/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 955150e..c02a547 100644 (file)
@@ -33,12 +33,12 @@ class ToscaTemplateOutputTest(TestCase):
                             'server, http://<IP>:3000',
                             'value':
                             {'get_attr':
-                             ['app_server', 'networks', 'private', 0]}},
+                             ['app_server', 'networks']}},
                            'mongodb_url':
                            {'description': 'URL for the mongodb server.',
                             'value':
                             {'get_attr':
-                             ['mongo_server', 'networks', 'private', 0]}}}
+                             ['mongo_server', 'networks']}}}
 
         hot_translation_dict = \
             toscaparser.utils.yamlparser.simple_parse(hot_translation)
index 45637ec..9ceb049 100644 (file)
@@ -332,7 +332,7 @@ class ToscaCompute(HotResource):
                   attriute.'))
         if attribute == 'private_address' or \
            attribute == 'public_address':
-                attr['get_attr'] = [self.name, 'networks', 'private', 0]
+                attr['get_attr'] = [self.name, 'networks']
 
         return attr
 
index a298745..1fbd44e 100644 (file)
@@ -52,8 +52,6 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -110,8 +108,6 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
       server:
         get_resource: mongo_server
     depends_on:
@@ -186,8 +182,6 @@ resources:
           get_attr:
           - logstash_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -279,8 +273,6 @@ resources:
           get_attr:
           - logstash_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -355,8 +347,6 @@ resources:
           get_attr:
           - elasticsearch_server
           - networks
-          - private
-          - 0
       server:
         get_resource: logstash_server
     depends_on:
@@ -430,14 +420,10 @@ resources:
           get_attr:
           - elasticsearch_server
           - networks
-          - private
-          - 0
         kibana_ip:
           get_attr:
           - kibana_server
           - networks
-          - private
-          - 0
       server:
         get_resource: kibana_server
     depends_on:
@@ -510,8 +496,6 @@ outputs:
       get_attr:
       - app_server
       - networks
-      - private
-      - 0
 
   mongodb_url:
     description: URL for the mongodb server.
@@ -519,8 +503,6 @@ outputs:
       get_attr:
       - mongo_server
       - networks
-      - private
-      - 0
 
   logstash_url:
     description: URL for the logstash server.
@@ -528,8 +510,6 @@ outputs:
       get_attr:
       - logstash_server
       - networks
-      - private
-      - 0
 
   elasticsearch_url:
     description: URL for the elasticsearch server.
@@ -537,8 +517,6 @@ outputs:
       get_attr:
       - elasticsearch_server
       - networks
-      - private
-      - 0
 
   kibana_url:
     description: URL for the kibana server.
@@ -546,6 +524,3 @@ outputs:
       get_attr:
       - kibana_server
       - networks
-      - private
-      - 0
-
index 5eb1701..50491ef 100644 (file)
@@ -52,8 +52,7 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
+
       server:
         get_resource: app_server
     depends_on:
@@ -110,8 +109,7 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
+
       server:
         get_resource: mongo_server
     depends_on:
@@ -186,8 +184,6 @@ resources:
           get_attr:
           - logstash_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -279,8 +275,6 @@ resources:
           get_attr:
           - logstash_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -355,8 +349,6 @@ resources:
           get_attr:
           - elasticsearch_server
           - networks
-          - private
-          - 0
       server:
         get_resource: logstash_server
     depends_on:
@@ -430,14 +422,11 @@ resources:
           get_attr:
           - elasticsearch_server
           - networks
-          - private
-          - 0
         kibana_ip:
           get_attr:
           - kibana_server
           - networks
-          - private
-          - 0
+
       server:
         get_resource: kibana_server
     depends_on:
@@ -510,8 +499,6 @@ outputs:
       get_attr:
       - app_server
       - networks
-      - private
-      - 0
 
   mongodb_url:
     description: URL for the mongodb server.
@@ -519,8 +506,6 @@ outputs:
       get_attr:
       - mongo_server
       - networks
-      - private
-      - 0
 
   logstash_url:
     description: URL for the logstash server.
@@ -528,8 +513,6 @@ outputs:
       get_attr:
       - logstash_server
       - networks
-      - private
-      - 0
 
   elasticsearch_url:
     description: URL for the elasticsearch server.
@@ -537,8 +520,6 @@ outputs:
       get_attr:
       - elasticsearch_server
       - networks
-      - private
-      - 0
 
   kibana_url:
     description: URL for the kibana server.
@@ -546,6 +527,4 @@ outputs:
       get_attr:
       - kibana_server
       - networks
-      - private
-      - 0
 
index 33f3059..29f12cc 100644 (file)
@@ -59,8 +59,6 @@ resources:
           get_attr:
           - logstash_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
index b95120b..3406b51 100644 (file)
@@ -46,8 +46,6 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
       server:
         get_resource: mongo_server
     depends_on:
@@ -120,8 +118,6 @@ resources:
           get_attr:
           - mongo_server
           - networks
-          - private
-          - 0
       server:
         get_resource: app_server
     depends_on:
@@ -173,13 +169,9 @@ outputs:
       get_attr:
       - mongo_server
       - networks
-      - private
-      - 0
   nodejs_url:
     description: URL for the nodejs server, http://<IP>:3000
     value:
       get_attr:
       - app_server
       - networks
-      - private
-      - 0
index 9ffaf23..0450b1f 100644 (file)
@@ -76,16 +76,12 @@ outputs:
       get_attr:
       - my_web_app_tier_1
       - networks
-      - private
-      - 0
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
       - networks
-      - private
-      - 0
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 9b5e71c..e65e789 100644 (file)
@@ -76,16 +76,12 @@ outputs:
       get_attr:
       - my_web_app_tier_1
       - networks
-      - private
-      - 0
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
       - networks
-      - private
-      - 0
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 1b4eb73..a8c114e 100644 (file)
@@ -80,16 +80,12 @@ outputs:
       get_attr:
       - my_web_app_tier_1
       - networks
-      - private
-      - 0
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
       - networks
-      - private
-      - 0
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 0311a55..59b46ae 100644 (file)
@@ -80,16 +80,12 @@ outputs:
       get_attr:
       - my_web_app_tier_1
       - networks
-      - private
-      - 0
   private_ip_2:
     description: The private IP address of the applications second tier.
     value:
       get_attr:
       - my_web_app_tier_2
       - networks
-      - private
-      - 0
   volume_id:
     description: The volume id of the block storage instance.
     value:
index 55ada08..cff83f9 100644 (file)
@@ -89,16 +89,12 @@ outputs:
       get_attr:
       - my_server
       - networks
-      - private
-      - 0
   server_ip_2:
     description: The private IP address of the applications second server.
     value:
       get_attr:
       - my_server2
       - networks
-      - private
-      - 0
   volume_id_1:
     description: The volume id of the first block storage instance.
     value:
index 3386d79..0fdcb4b 100644 (file)
@@ -89,16 +89,12 @@ outputs:
       get_attr:
       - my_server
       - networks
-      - private
-      - 0
   server_ip_2:
     description: The private IP address of the applications second server.
     value:
       get_attr:
       - my_server2
       - networks
-      - private
-      - 0
   volume_id_1:
     description: The volume id of the first block storage instance.
     value: