mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[676-add-support-for-server-tags-in-the-cb_cmds-hooks-library] Addressed comments
This commit is contained in:
parent
2840515b1f
commit
06826b5e5c
@ -188,6 +188,7 @@ TestConfigBackendDHCPv4::getModifiedOptions4(const db::ServerSelector& /* server
|
||||
StampedValuePtr
|
||||
TestConfigBackendDHCPv4::getGlobalParameter4(const db::ServerSelector& server_selector,
|
||||
const std::string& name) const {
|
||||
auto candidate = StampedValuePtr();
|
||||
const auto& index = globals_.get<StampedValueNameIndexTag>();
|
||||
auto global_range = index.equal_range(name);
|
||||
for (auto global_it = global_range.first; global_it != global_range.second;
|
||||
@ -196,16 +197,13 @@ TestConfigBackendDHCPv4::getGlobalParameter4(const db::ServerSelector& server_se
|
||||
for (auto tag : tags) {
|
||||
if ((*global_it)->hasServerTag(ServerTag(tag))) {
|
||||
return (*global_it);
|
||||
} else if ((*global_it)->hasAllServerTag()) {
|
||||
candidate = *global_it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto global_all_it = index.find(name);
|
||||
if ((global_all_it != index.end()) && ((*global_all_it)->hasAllServerTag())) {
|
||||
return (*global_all_it);
|
||||
}
|
||||
|
||||
return (StampedValuePtr());
|
||||
return (candidate);
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,6 +187,7 @@ TestConfigBackendDHCPv6::getModifiedOptions6(const db::ServerSelector& /* server
|
||||
StampedValuePtr
|
||||
TestConfigBackendDHCPv6::getGlobalParameter6(const db::ServerSelector& server_selector,
|
||||
const std::string& name) const {
|
||||
auto candidate = StampedValuePtr();
|
||||
const auto& index = globals_.get<StampedValueNameIndexTag>();
|
||||
auto global_range = index.equal_range(name);
|
||||
for (auto global_it = global_range.first; global_it != global_range.second;
|
||||
@ -196,15 +197,12 @@ TestConfigBackendDHCPv6::getGlobalParameter6(const db::ServerSelector& server_se
|
||||
if ((*global_it)->hasServerTag(ServerTag(tag))) {
|
||||
return (*global_it);
|
||||
}
|
||||
} else if ((*global_it)->hasAllServerTag()) {
|
||||
candidate = *global_it;
|
||||
}
|
||||
}
|
||||
|
||||
auto global_all_it = index.find(name);
|
||||
if ((global_all_it != index.end()) && ((*global_all_it)->hasAllServerTag())) {
|
||||
return (*global_all_it);
|
||||
}
|
||||
|
||||
return (StampedValuePtr());
|
||||
return (candidate);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user