Fix multiple assignment of redfish_system_id during node creation

``redfish_system_id`` is being passed multiple times to the node at
creation as ``node_options`` never defaults back to it's initial state
throughout the iteration of the while loop.

Though it is surprisingly functional, it's fragile and this change aims
to fix that.

Closes-Bug: #2054597
Change-Id: I2c151afafb86191f047985ac00075a791639646d
This commit is contained in:
cid 2024-02-22 11:43:44 +01:00
parent 0cfe290d15
commit abe8843ddc

View File

@ -2450,19 +2450,19 @@ function enroll_nodes {
local ironic_hwinfo_file=$IRONIC_VM_MACS_CSV_FILE
if is_deployed_by_ipmi; then
local node_options="\
local deploy_options="\
--driver-info ipmi_address=${HOST_IP} \
--driver-info ipmi_username=admin \
--driver-info ipmi_password=password"
elif is_deployed_by_snmp; then
local node_options="\
local deploy_options="\
--driver-info snmp_driver=${IRONIC_VPDU_SNMPDRIVER} \
--driver-info snmp_address=${HOST_IP} \
--driver-info snmp_port=${IRONIC_VPDU_LISTEN_PORT} \
--driver-info snmp_protocol=2c \
--driver-info snmp_community=${IRONIC_VPDU_COMMUNITY}"
elif is_deployed_by_redfish; then
local node_options="\
local deploy_options="\
--driver-info redfish_address=http://${HOST_IP}:${IRONIC_REDFISH_EMULATOR_PORT} \
--driver-info redfish_username=admin \
--driver-info redfish_password=password"
@ -2486,6 +2486,8 @@ function enroll_nodes {
local node_name
node_name=$node_prefix-$total_nodes
local node_options="$deploy_options"
local node_capabilities=""
if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then
node_capabilities+=" --property capabilities=boot_mode:uefi"