@@ -47,7 +47,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
4747 DatabaseConnection::ParameterMap parameters = DatabaseConnection::parse (dbaccess);
4848 std::string redacted = DatabaseConnection::redactedAccessString (parameters);
4949
50- // Get the database type and open the corresponding database
50+ // Get the database type and open the corresponding database.
5151 DatabaseConnection::ParameterMap::iterator it = parameters.find (type);
5252 if (it == parameters.end ()) {
5353 LOG_ERROR (dhcpsrv_logger, DHCPSRV_NOTYPE_DB).arg (dbaccess);
@@ -88,8 +88,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
8888
8989 // No match?
9090 if (index == map_.end ()) {
91- if ((db_type == " mysql" ) ||
92- (db_type == " postgresql" )) {
91+ if ((db_type == " mysql" ) || (db_type == " postgresql" )) {
9392 LOG_ERROR (dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg (db_type);
9493 string with = (db_type == " postgresql" ? " pgsql" : db_type);
9594 isc_throw (InvalidType, " The Kea server has not been compiled with "
@@ -106,10 +105,10 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
106105 // Call the factory.
107106 getLeaseMgrPtr () = index->second (parameters);
108107
109- // Check the factory did not return NULL .
108+ // Check the factory did not return null .
110109 if (!getLeaseMgrPtr ()) {
111110 isc_throw (Unexpected, " Lease database " << db_type <<
112- " factory returned NULL " );
111+ " factory returned null " );
113112 }
114113}
115114
@@ -159,7 +158,7 @@ LeaseMgrFactory::haveInstance() {
159158TrackingLeaseMgr&
160159LeaseMgrFactory::instance () {
161160 TrackingLeaseMgr* lmptr = getLeaseMgrPtr ().get ();
162- if (lmptr == NULL ) {
161+ if (! lmptr) {
163162 isc_throw (NoLeaseManager, " no current lease manager is available" );
164163 }
165164 return (*lmptr);
@@ -208,14 +207,18 @@ LeaseMgrFactory::registeredFactory(const std::string& db_type) {
208207}
209208
210209void
211- LeaseMgrFactory::printRegistered () {
210+ LeaseMgrFactory::logRegistered () {
212211 std::stringstream txt;
213212
214213 for (auto const & x : map_) {
215- txt << x.first << " " ;
214+ if (!txt.str ().empty ()) {
215+ txt << " " ;
216+ }
217+ txt << x.first ;
216218 }
217219
218- LOG_INFO (dhcpsrv_logger, DHCPSRV_LEASE_MGR_BACKENDS_REGISTERED).arg (txt.str ());
220+ LOG_INFO (dhcpsrv_logger, DHCPSRV_LEASE_MGR_BACKENDS_REGISTERED)
221+ .arg (txt.str ());
219222}
220223
221224} // namespace dhcp
0 commit comments