Skip to content

Commit

Permalink
Change 'node_start_ip' answerfile variable to 'node_ip' (#49)
Browse files Browse the repository at this point in the history
Signed-off-by: lbgracioso <[email protected]>
  • Loading branch information
lbgracioso authored Mar 5, 2024
1 parent 93c7ce6 commit 4a87d58
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 26 deletions.
4 changes: 2 additions & 2 deletions example.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ kernel=5.4.17-2136.302.6.1.el8uek.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -76,7 +76,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
15 changes: 7 additions & 8 deletions src/answerfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,14 @@ AnswerFile::AFNode AnswerFile::loadNode(const std::string& section)
node.mac_address = m_ini.getValue(section, "mac_address", false);
}

if (m_ini.exists(section, "node_start_ip")) {
if (m_ini.exists(section, "node_ip")) {
try {
node.start_ip = convertStringToAddress(
m_ini.getValue(section, "node_start_ip"));
node.start_ip
= convertStringToAddress(m_ini.getValue(section, "node_ip"));
} catch (const std::runtime_error& e) {
throw std::runtime_error(
fmt::format("Section '{}' field 'node_start_ip' "
"validation failed - {}",
section, e.what()));
throw std::runtime_error(fmt::format("Section '{}' field 'node_ip' "
"validation failed - {}",
section, e.what()));
}
}

Expand Down Expand Up @@ -318,7 +317,7 @@ AnswerFile::AFNode AnswerFile::validateNode(AnswerFile::AFNode node)
throw std::runtime_error(
fmt::format("Node must have a \"{0}\" key or you must inform a "
"generic \"{0}\" value",
"node_start_ip"));
"node_ip"));
}
node.start_ip = nodes.generic->start_ip;
}
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/alma-8.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/alma-9.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/oracle-8.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/oracle-9.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/rhel-8.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/rhel-9.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/rocky-8.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down
4 changes: 2 additions & 2 deletions vagrant/include/rocky-9.answerfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kernel=4.18.0-513.5.1.el8_9.x86_64
[node]
prefix=n
padding=2
node_start_ip=172.26.0.1
node_ip=172.26.0.1
node_root_password=pwd
sockets=1
cores_per_socket=1
Expand All @@ -75,7 +75,7 @@ bmc_serialspeed=9600
# Hostname is optional. If commented, you MUST specify "prefix" and "padding".
hostname=foo
mac_address=ca:fe:de:ad:be:ef
#node_start_ip=172.26.0.1
#node_ip=172.26.0.1
#node_root_password=pwd
#sockets=1
#cores_per_socket=1
Expand Down

0 comments on commit 4a87d58

Please sign in to comment.