Fix vcpu_pin_set condition to resolve deployment failure

In change I40e0ed0bba93bfcdc4cf157195c3e9fbcfce0776
vcpu_pin_set parameter was deprecated and superseded by
cpu_shared_set and cpu_dedicated_set parameters.

The default value for vcpu_pin_set via THT parameter
NovaComputeVcpuPinSet is [].
When NovaComputeDedicatedSet parameter is defined with
valid value (eg. ['4-12,^8,15'] then below code snippet
executes if block instead of else block even though
vcpu_pin_set is empty and raises error [1].
```
  if !empty($vcpu_pin_set) or $vcpu_pin_set != undef {
    $vcpu_pin_set_real = join(any2array($vcpu_pin_set), ',')
  } else {
    $vcpu_pin_set_real = undef
  }
```
when vcpu_pin_set is [], the if condition is true because of
expression after or operator, this change modifies the if
condition to set vcpu_pin_set_real to undef, whenever
vcpu_pin_set is either empty or undef.

[1] 890dc6fa44/manifests/compute.pp (L281)

Change-Id: I6d45683f7f5aaed15bb193252b89e5c483d3f162
Closes-Bug: #1853557
This commit is contained in:
Rajesh Tailor 2019-11-22 11:08:18 +05:30
parent 890dc6fa44
commit 4cae6a6ebc
1 changed files with 3 additions and 3 deletions

View File

@ -271,10 +271,10 @@ class nova::compute (
warning('vcpu_pin_set is deprecated, instead use cpu_dedicated_set or cpu_shared_set.')
}
if !empty($vcpu_pin_set) or $vcpu_pin_set != undef {
$vcpu_pin_set_real = join(any2array($vcpu_pin_set), ',')
} else {
if empty($vcpu_pin_set) {
$vcpu_pin_set_real = undef
} else {
$vcpu_pin_set_real = join(any2array($vcpu_pin_set), ',')
}
if $vcpu_pin_set_real and !is_service_default($cpu_dedicated_set_real) {