Use the server name attribute
authorSteve Baker <sbaker@redhat.com>
Sat, 13 Sep 2014 22:05:43 +0000 (10:05 +1200)
committerSteve Baker <sbaker@redhat.com>
Sat, 13 Sep 2014 22:05:43 +0000 (10:05 +1200)
The 'show' attribute results in a nova API call, which has
performance overhead even with attribute memoization.
The name attribute was added to expose the name without needing
an API call, since the resource already knows the name. This
change switches from using 'show' to 'name' throughout.

Change-Id: I1e83dd008cd02e5cec97868db0d5a695f07b7199

overcloud-source.yaml
undercloud-source.yaml

index 3dbd571..a9f3986 100644 (file)
@@ -447,11 +447,9 @@ resources:
               - 0
               - Merge::Map:
                   controller0:
-                  - Fn::Select:
+                  - get_attr:
+                    - controller0
                     - name
-                    - get_attr:
-                      - controller0
-                      - show
           nodeid: {get_input: bootstack_nodeid}
         database:
           host: &database_host
@@ -533,7 +531,7 @@ resources:
               nodes:
                 Merge::Map:
                   controller0:
-                    {get_attr: [controller0, show, name]}
+                    {get_attr: [controller0, name]}
         keystone:
           db:
             Fn::Join:
@@ -678,7 +676,7 @@ resources:
             Merge::Map:
               controller0:
                 ip: {get_attr: [controller0, networks, ctlplane, 0]}
-                name: {get_attr: [controller0, show, name]}
+                name: {get_attr: [controller0, name]}
           net_binds:
             - ip: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]}
           services:
@@ -778,7 +776,7 @@ resources:
       config: {get_resource: controllerConfig}
       server: {get_resource: controller0}
       input_values:
-        bootstack_nodeid: {get_attr: [controller0, show, name]}
+        bootstack_nodeid: {get_attr: [controller0, name]}
         controller_host: {get_attr: [controller0, networks, ctlplane, 0]}
         controller_virtual_ip:
           {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]}
@@ -815,10 +813,10 @@ resources:
                     Fn::Join:
                     - ' '
                     - - {get_attr: [NovaCompute0, networks, ctlplane, 0]}
-                      - {get_attr: [NovaCompute0, show, name]}
+                      - {get_attr: [NovaCompute0, name]}
                       - Fn::Join:
                         - '.'
-                        - - {get_attr: [NovaCompute0, show, name]}
+                        - - {get_attr: [NovaCompute0, name]}
                           - 'novalocal'
             - Fn::Join:
               - "\n"
@@ -827,10 +825,10 @@ resources:
                     Fn::Join:
                     - ' '
                     - - {get_attr: [BlockStorage0, networks, ctlplane, 0]}
-                      - {get_attr: [BlockStorage0, show, name]}
+                      - {get_attr: [BlockStorage0, name]}
                       - Fn::Join:
                         - '.'
-                        - - {get_attr: [BlockStorage0, show, name]}
+                        - - {get_attr: [BlockStorage0, name]}
                           - 'novalocal'
             - Fn::Join:
               - "\n"
@@ -839,10 +837,10 @@ resources:
                     Fn::Join:
                     - ' '
                     - - {get_attr: [SwiftStorage0, networks, ctlplane, 0]}
-                      - {get_attr: [SwiftStorage0, show, name]}
+                      - {get_attr: [SwiftStorage0, name]}
                       - Fn::Join:
                         - '.'
-                        - - {get_attr: [SwiftStorage0, show, name]}
+                        - - {get_attr: [SwiftStorage0, name]}
                           - 'novalocal'
             - Fn::Join:
               - "\n"
@@ -851,10 +849,10 @@ resources:
                     Fn::Join:
                     - ' '
                     - - {get_attr: [controller0, networks, ctlplane, 0]}
-                      - {get_attr: [controller0, show, name]}
+                      - {get_attr: [controller0, name]}
                       - Fn::Join:
                         - '.'
-                        - - {get_attr: [controller0, show, name]}
+                        - - {get_attr: [controller0, name]}
                           - 'novalocal'
                       - {get_param: CloudName}
         rabbit:
@@ -863,7 +861,7 @@ resources:
               - ','
               - Merge::Map:
                   controller0:
-                    {get_attr: [controller0, show, name]}
+                    {get_attr: [controller0, name]}
   controller0SSLDeployment:
     type: OS::Heat::StructuredDeployment
     properties:
index 0788e8b..2fcadd9 100644 (file)
@@ -230,11 +230,9 @@ resources:
               - 0
               - Merge::Map:
                   undercloud:
-                  - Fn::Select:
+                  - get_attr:
+                    - undercloud
                     - name
-                    - get_attr:
-                      - undercloud
-                      - show
           nodeid: {get_input: bootstack_nodeid}
         bootstack:
           public_interface_ip:
@@ -363,7 +361,6 @@ resources:
         bootstack_nodeid:
           get_attr:
           - undercloud
-          - show
           - name
         controller_host:
           get_attr: