Generalization of recursive function
[apex.git] / build / ovs-dpdk-preconfig.yaml
index d57b0b7..bfa0b17 100644 (file)
@@ -1,3 +1,4 @@
+---
 heat_template_version: 2014-10-16
 
 description: >
@@ -6,16 +7,16 @@ description: >
 parameters:
   server:
     type: string
-  OvsDpdkCoreList:
+  HostCpusList:
     description: >
       List of logical cores for OVS DPDK
     type: string
     default: ""
-  OvsDpdkSocketMemory:
+  NeutronDpdkSocketMemory:
     description: Memory allocated for each socket
     default: ""
     type: string
-  PmdCoreList:
+  NeutronDpdkCoreList:
     description: >
       A list or range of physical CPU cores to be pinned to PMD
       The given args will be appended to the tuned cpu-partitioning profile.
@@ -27,7 +28,7 @@ resources:
   OvsDpdkSetup:
     type: OS::Heat::StructuredDeployment
     properties:
-      server:  {get_param: server}
+      server: {get_param: server}
       config: {get_resource: OvsDpdkConfig}
 
   OvsDpdkConfig:
@@ -81,20 +82,23 @@ resources:
             sed  -i "s/#group\s*=.*/group = \"root\"/" /etc/libvirt/qemu.conf
             ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
             if [ -n "$SOCKET_MEMORY" ]; then
-              ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=$SOCKET_MEMORY
+              other_config="dpdk-socket-mem=$SOCKET_MEMORY"
+              ovs-vsctl --no-wait set Open_vSwitch . other_config:$other_config
             fi
             if [ -n "$pmd_cpu_mask" ]; then
-              ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=$pmd_cpu_mask
+              other_config="pmd-cpu-mask=$pmd_cpu_mask"
+              ovs-vsctl --no-wait set Open_vSwitch . other_config:$other_config
             fi
             if [ -n "$dpdk_lcore_mask" ]; then
-              ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=$dpdk_lcore_mask
+              other_config="dpdk-lcore-mask=$dpdk_lcore_mask"
+              ovs-vsctl --no-wait set Open_vSwitch . other_config:$other_config
             fi
             systemctl restart openvswitch
 
           params:
-            $DPDK_CORES: {get_param: OvsDpdkCoreList}
-            $PMD_CORES: {get_param: PmdCoreList}
-            $SOCKET_MEMORY: {get_param: OvsDpdkSocketMemory}
+            $DPDK_CORES: {get_param: HostCpusList}
+            $PMD_CORES: {get_param: NeutronDpdkCoreList}
+            $SOCKET_MEMORY: {get_param: NeutronDpdkSocketMemory}
 outputs:
   deploy_stdout:
     description: Output of the extra dpdk ovs  deployment