Make the errors around fencing and IHA clearer

Distinguish the error messages between no ipmilan device
configured or more than once device configured.

Change-Id: Iffda14d1488de09e57dfe0746a486a8cb78f110b
(cherry picked from commit a2b00bf7f2)
This commit is contained in:
Michele Baldessari 2018-07-05 09:58:53 +02:00 committed by Luca Miccini
parent 151177ef16
commit c5889c8dad
1 changed files with 5 additions and 2 deletions

View File

@ -78,8 +78,11 @@ class tripleo::fencing(
$ipmilan_devices = local_fence_devices('fence_ipmilan', $all_devices) $ipmilan_devices = local_fence_devices('fence_ipmilan', $all_devices)
create_resources('pacemaker::stonith::fence_ipmilan', $ipmilan_devices, $common_params) create_resources('pacemaker::stonith::fence_ipmilan', $ipmilan_devices, $common_params)
if ($enable_instanceha and $is_compute_instanceha_node) { if ($enable_instanceha and $is_compute_instanceha_node) {
if length($ipmilan_devices) != 1 { if length($ipmilan_devices) < 1 {
fail('Multiple (or zero) IPmilan devices for a single host are not supported with instance HA') fail('You must specify an IPmilan device for a host when configuring instance HA')
}
if length($ipmilan_devices) > 1 {
fail('Multiple IPmilan devices for a single host are not supported with instance HA')
} }
# Get the first (and only) key which is the mac-address # Get the first (and only) key which is the mac-address
$mac = keys($ipmilan_devices)[0] $mac = keys($ipmilan_devices)[0]