Commit 1c59d638 authored by Francis Dupont's avatar Francis Dupont

[576-cb-cmds-empty-value-for-next-server-parameter-is-accepted-which-causes-mi...

[576-cb-cmds-empty-value-for-next-server-parameter-is-accepted-which-causes-misconfiguration] Moved the body to .cc
parent 1a2e25d0
......@@ -117,6 +117,24 @@ Network::hrModeFromString(const std::string& hr_mode_name) {
}
}
Optional<IOAddress>
Network::getGlobalProperty(Optional<IOAddress> property,
const std::string& global_name) const {
if (!global_name.empty() && fetch_globals_fn_) {
ConstElementPtr globals = fetch_globals_fn_();
if (globals && (globals->getType() == Element::map)) {
ConstElementPtr global_param = globals->get(global_name);
if (global_param) {
std::string global_str = global_param->stringValue();
if (!global_str.empty()) {
return (IOAddress(global_str));
}
}
}
}
return (property);
}
ElementPtr
Network::toElement() const {
ElementPtr map = Element::createMap();
......
......@@ -589,21 +589,7 @@ protected:
/// of @c property.
util::Optional<asiolink::IOAddress>
getGlobalProperty(util::Optional<asiolink::IOAddress> property,
const std::string& global_name) const {
if (!global_name.empty() && fetch_globals_fn_) {
data::ConstElementPtr globals = fetch_globals_fn_();
if (globals && (globals->getType() == data::Element::map)) {
data::ConstElementPtr global_param = globals->get(global_name);
if (global_param) {
std::string global_str = global_param->stringValue();
if (!global_str.empty()) {
return (asiolink::IOAddress(global_str));
}
}
}
}
return (property);
}
const std::string& global_name) const;
/// @brief Returns a value associated with a network using inheritance.
///
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment