From 4a87d588fdb6c3b0578e112d31a7090f09246da1 Mon Sep 17 00:00:00 2001 From: Lucas Gracioso <34951068+lbgracioso@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:36:30 -0300 Subject: [PATCH] Change 'node_start_ip' answerfile variable to 'node_ip' (#49) Signed-off-by: lbgracioso --- example.answerfile.ini | 4 ++-- src/answerfile.cpp | 15 +++++++-------- vagrant/include/alma-8.answerfile.ini | 4 ++-- vagrant/include/alma-9.answerfile.ini | 4 ++-- vagrant/include/oracle-8.answerfile.ini | 4 ++-- vagrant/include/oracle-9.answerfile.ini | 4 ++-- vagrant/include/rhel-8.answerfile.ini | 4 ++-- vagrant/include/rhel-9.answerfile.ini | 4 ++-- vagrant/include/rocky-8.answerfile.ini | 4 ++-- vagrant/include/rocky-9.answerfile.ini | 4 ++-- 10 files changed, 25 insertions(+), 26 deletions(-) diff --git a/example.answerfile.ini b/example.answerfile.ini index db86039d..2dabf931 100644 --- a/example.answerfile.ini +++ b/example.answerfile.ini @@ -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 @@ -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 diff --git a/src/answerfile.cpp b/src/answerfile.cpp index 89dcf7e0..b0b32f58 100644 --- a/src/answerfile.cpp +++ b/src/answerfile.cpp @@ -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())); } } @@ -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; } diff --git a/vagrant/include/alma-8.answerfile.ini b/vagrant/include/alma-8.answerfile.ini index 3da931f4..bc40c016 100644 --- a/vagrant/include/alma-8.answerfile.ini +++ b/vagrant/include/alma-8.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/alma-9.answerfile.ini b/vagrant/include/alma-9.answerfile.ini index 766454e5..d96090a7 100644 --- a/vagrant/include/alma-9.answerfile.ini +++ b/vagrant/include/alma-9.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/oracle-8.answerfile.ini b/vagrant/include/oracle-8.answerfile.ini index 591cf90f..4962306a 100644 --- a/vagrant/include/oracle-8.answerfile.ini +++ b/vagrant/include/oracle-8.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/oracle-9.answerfile.ini b/vagrant/include/oracle-9.answerfile.ini index b007e90c..921c837c 100644 --- a/vagrant/include/oracle-9.answerfile.ini +++ b/vagrant/include/oracle-9.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/rhel-8.answerfile.ini b/vagrant/include/rhel-8.answerfile.ini index 2b1e7ff2..303a36fd 100644 --- a/vagrant/include/rhel-8.answerfile.ini +++ b/vagrant/include/rhel-8.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/rhel-9.answerfile.ini b/vagrant/include/rhel-9.answerfile.ini index 4092d5d3..7feabf98 100644 --- a/vagrant/include/rhel-9.answerfile.ini +++ b/vagrant/include/rhel-9.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/rocky-8.answerfile.ini b/vagrant/include/rocky-8.answerfile.ini index d93dbf75..048f228a 100644 --- a/vagrant/include/rocky-8.answerfile.ini +++ b/vagrant/include/rocky-8.answerfile.ini @@ -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 @@ -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 diff --git a/vagrant/include/rocky-9.answerfile.ini b/vagrant/include/rocky-9.answerfile.ini index 5134660b..73cf2f4c 100644 --- a/vagrant/include/rocky-9.answerfile.ini +++ b/vagrant/include/rocky-9.answerfile.ini @@ -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 @@ -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