]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2815] Fix unit tests
authorSlawek Figiel <slawek@isc.org>
Mon, 3 Apr 2023 18:14:44 +0000 (20:14 +0200)
committerSlawek Figiel <slawek@isc.org>
Thu, 25 May 2023 11:29:28 +0000 (13:29 +0200)
src/lib/dhcpsrv/host_mgr.cc
src/lib/dhcpsrv/host_mgr.h

index 55f077c1e32c1fb941f3c73a7edf65f1bb325a4b..0b5dd5a42c44acd87a88c4528ecc4229074b7366 100644 (file)
@@ -645,7 +645,7 @@ HostMgr::add(const HostPtr& host, const HostMgrOperationTarget target) {
 
     if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) {
         // Don't throw if all targets were selected.
-        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) {
+        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
             isc_throw(NoHostDataSourceManager, "Unable to add new host because there is "
                     "no hosts-database configured.");
             
@@ -673,7 +673,7 @@ HostMgr::del(const SubnetID& subnet_id, const asiolink::IOAddress& addr,
 
     if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) {
         // Don't throw if all targets were selected.
-        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) {
+        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
             isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
                     "no hosts-database configured.");
         }
@@ -701,7 +701,7 @@ HostMgr::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_
 
     if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) {
         // Don't throw if all targets were selected.
-        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) {
+        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
             isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
                     "no hosts-database configured.");
         }
@@ -729,7 +729,7 @@ HostMgr::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_
 
     if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) {
         // Don't throw if all targets were selected.
-        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) {
+        if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
             isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
                     "no hosts-database configured.");
         }
index 671433e999675d59a428714e856e57638e9859e3..06dbce31a3fb40a15a43a464b601311fc2605721 100644 (file)
@@ -169,7 +169,7 @@ public:
     ///
     /// @return Collection of const @c Host objects.
     ConstHostCollection
-    getAll4(const SubnetID& subnet_id, const HostMgrOperationTarget target) const;
+    getAll4(const SubnetID& subnet_id, const HostMgrOperationTarget target=HostMgrOperationTarget::ALL_SOURCES) const;
 
     /// @brief Return all hosts in a DHCPv6 subnet.
     ///