From 3a697117c88d3aa1f64108f771bb13f6eb8367ef Mon Sep 17 00:00:00 2001 From: Allain Legacy Date: Thu, 22 Nov 2018 09:40:19 -0600 Subject: [PATCH] puppet-manifests: validate cpu list before setting latencies Do not attempt to set wakeup latency unless the list of CPU instances is non-empty. If either the low or high wakeup list is empty then there is no need to attempt to run the script. Running the script with an empty list results in a manifest apply errors and fails the node initialization. Story: 2004357 Task: 27957 Change-Id: I89f19388d131b6c377020c55f5b13960738e350d Signed-off-by: Allain Legacy --- puppet-manifests/centos/build_srpm.data | 2 +- .../src/modules/platform/manifests/compute.pp | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/puppet-manifests/centos/build_srpm.data b/puppet-manifests/centos/build_srpm.data index cc746d762c..5610037e43 100644 --- a/puppet-manifests/centos/build_srpm.data +++ b/puppet-manifests/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="src" -TIS_PATCH_VER=73 +TIS_PATCH_VER=74 diff --git a/puppet-manifests/src/modules/platform/manifests/compute.pp b/puppet-manifests/src/modules/platform/manifests/compute.pp index a7d450cd4d..f150c5afb0 100644 --- a/puppet-manifests/src/modules/platform/manifests/compute.pp +++ b/puppet-manifests/src/modules/platform/manifests/compute.pp @@ -280,18 +280,22 @@ class platform::compute::pmqos ( $script = "/usr/bin/set-cpu-wakeup-latency.sh" - # Set low wakeup latency (shallow C-state) for vswitch CPUs using PM QoS interface - exec { "low-wakeup-latency": - command => "${script} low ${low_wakeup_cpus}", - onlyif => "test -f ${script}", - logoutput => true, + if $low_wakeup_cpus != '""' { + # Set low wakeup latency (shallow C-state) for vswitch CPUs using PM QoS interface + exec { "low-wakeup-latency": + command => "${script} low ${low_wakeup_cpus}", + onlyif => "test -f ${script}", + logoutput => true, + } } - #Set high wakeup latency (deep C-state) for non-vswitch CPUs using PM QoS interface - exec { "high-wakeup-latency": - command => "${script} high ${hight_wakeup_cpus}", - onlyif => "test -f ${script}", - logoutput => true, + if $hight_wakeup_cpus != '""' { + #Set high wakeup latency (deep C-state) for non-vswitch CPUs using PM QoS interface + exec { "high-wakeup-latency": + command => "${script} high ${hight_wakeup_cpus}", + onlyif => "test -f ${script}", + logoutput => true, + } } } }