From: Francis Dupont Date: Wed, 6 Mar 2019 20:24:38 +0000 (+0100) Subject: [478-improve-error-message-database-backend-mysql] Reviewed changes and addressed... X-Git-Tag: 465-add-subnet4-update-and-subnet6-update-commands-to-subnet-cmds-hook_base2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41f40b7dc68258eaf27b68980b23e69db3ac2251;p=thirdparty%2Fkea.git [478-improve-error-message-database-backend-mysql] Reviewed changes and addressed comments --- diff --git a/src/lib/dhcpsrv/host_data_source_factory.cc b/src/lib/dhcpsrv/host_data_source_factory.cc index f681c9f530..d6f5ee8ac1 100644 --- a/src/lib/dhcpsrv/host_data_source_factory.cc +++ b/src/lib/dhcpsrv/host_data_source_factory.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -61,10 +61,13 @@ HostDataSourceFactory::add(HostDataSourceList& sources, // No match? if (index == map_.end()) { - if ( (db_type == "mysql") || (db_type == "pgsql") || (db_type == "cql")) { + if ((db_type == "mysql") || + (db_type == "postgresql") || + (db_type == "cql")) { + string with = (db_type == "postgresql" ? "pgsql" : db_type); isc_throw(InvalidType, "The type of host backend: '" << db_type - << "' is not compiled in. Did you forget to use --with-mysql," - << " --with-pgsql or --with-cql during compilation?"); + << "' is not compiled in. Did you forget to use --with-" + << with << " during compilation?"); } isc_throw(InvalidType, "The type of host backend: '" << db_type << "' is not supported"); diff --git a/src/lib/dhcpsrv/lease_mgr_factory.cc b/src/lib/dhcpsrv/lease_mgr_factory.cc index 068cfb0e5a..30269c02c8 100644 --- a/src/lib/dhcpsrv/lease_mgr_factory.cc +++ b/src/lib/dhcpsrv/lease_mgr_factory.cc @@ -65,7 +65,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) { return; #else LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("mysql"); - isc_throw(InvalidType, "The Kea server has not been built with " + isc_throw(InvalidType, "The Kea server has not been compiled with " "support for database type: mysql"); #endif } @@ -77,7 +77,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) { return; #else LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("postgresql"); - isc_throw(InvalidType, "The Kea server has not been built with " + isc_throw(InvalidType, "The Kea server has not been compiled with " "support for database type: postgresql"); #endif } @@ -88,7 +88,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) { return; #else LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("cql"); - isc_throw(InvalidType, "The Kea server has not been built with " + isc_throw(InvalidType, "The Kea server has not been compiled with " "support for database type: cql"); #endif }