2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#2436] More review comments

Use "client-classes" not "classes" in user-context

src/lib/dhcpsrv/memfile_lease_limits.cc
src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/memfile_lease_limits_unittest.cc
This commit is contained in:
Thomas Markwalder
2022-06-24 10:54:00 -04:00
parent 34a229f6e8
commit aea23444dc
3 changed files with 9 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ ClassLeaseCounter::getLeaseClientClasses(LeasePtr lease) const {
ConstElementPtr classes;
auto ctx = lease->getContext();
if (ctx) {
classes = ctx->find("ISC/classes");
classes = ctx->find("ISC/client-classes");
if (classes && classes->getType() != Element::list) {
isc_throw(Unexpected, "getLeaseClientClasses: "
<< lease->toText() << " is not a list!");
@@ -116,7 +116,7 @@ ClassLeaseCounter::updateLease(LeasePtr new_lease, LeasePtr old_lease) {
uint32_t old_state = old_lease->state_;
// Did we change states or classes?
// Note we do not worry about lease type changes, because its makes no
// Note we do not worry about lease type changes, because it makes no
// business sense to repurpose a lease as a different type. Other than
// some unit tests unrelated to this it never occurs in the code.
if ((old_state != new_state) || (old_classes != new_classes)) {

View File

@@ -4015,9 +4015,9 @@ GenericLeaseMgrTest::makeContextWithClasses(const std::list<ClientClass>& classe
clist->add(Element::create(client_class));
}
ElementPtr extended_info = Element::createMap();
extended_info->set("classes", clist);
ctx->set("ISC", extended_info);
ElementPtr client_classes = Element::createMap();
client_classes->set("client-classes", clist);
ctx->set("ISC", client_classes);
}
return (ctx);

View File

@@ -48,7 +48,7 @@ public:
///
/// {
/// "ISC": {
/// "classes": [ "class0", "class1", ... ]
/// "client-classes": [ "class0", "class1", ... ]
/// }
/// }
///
@@ -62,9 +62,9 @@ public:
clist->add(Element::create(client_class));
}
ElementPtr extended_info = Element::createMap();
extended_info->set("classes", clist);
ctx->set("ISC", extended_info);
ElementPtr client_classes = Element::createMap();
client_classes->set("client-classes", clist);
ctx->set("ISC", client_classes);
}
return (ctx);