From: Razvan Becheriu Date: Wed, 18 Sep 2024 11:17:16 +0000 (+0300) Subject: [#3536] removed empty line in getDBVersions X-Git-Tag: Kea-2.7.4~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38ea2d6dabba8dc334ee27ced5b5e06e7007e819;p=thirdparty%2Fkea.git [#3536] removed empty line in getDBVersions --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 987cdc56ec..14929c54ac 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -5016,11 +5016,17 @@ Dhcpv4Srv::getVersion(bool extended) { tmp << "premium: " << PREMIUM_EXTENDED_VERSION << endl; tmp << "linked with:" << endl; tmp << "- " << Logger::getVersion() << endl; - tmp << "- " << CryptoLink::getVersion() << endl; - tmp << "lease backends:" << endl; - tmp << LeaseMgrFactory::getDBVersions() << endl; - tmp << "host backends:" << endl; - tmp << HostDataSourceFactory::getDBVersions(); + tmp << "- " << CryptoLink::getVersion(); + auto info = LeaseMgrFactory::getDBVersions(); + if (!info.empty()) { + tmp << endl <<"lease backends:" << endl; + tmp << info; + } + info = HostDataSourceFactory::getDBVersions(); + if (!info.empty()) { + tmp << endl << "host backends:" << endl; + tmp << info; + } // @todo: more details about database runtime } diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index f2bcbce1e5..003ddc514b 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -4693,11 +4693,17 @@ Dhcpv6Srv::getVersion(bool extended) { tmp << "premium: " << PREMIUM_EXTENDED_VERSION << endl; tmp << "linked with:" << endl; tmp << "- " << Logger::getVersion() << endl; - tmp << "- " << CryptoLink::getVersion() << endl; - tmp << "lease backends:" << endl; - tmp << LeaseMgrFactory::getDBVersions() << endl; - tmp << "host backends:" << endl; - tmp << HostDataSourceFactory::getDBVersions(); + tmp << "- " << CryptoLink::getVersion(); + auto info = LeaseMgrFactory::getDBVersions(); + if (!info.empty()) { + tmp << endl <<"lease backends:" << endl; + tmp << info; + } + info = HostDataSourceFactory::getDBVersions(); + if (!info.empty()) { + tmp << endl << "host backends:" << endl; + tmp << info; + } // @todo: more details about database runtime }