From: Marcin Siodelski Date: Fri, 29 Jul 2016 07:55:40 +0000 (+0200) Subject: [4489] Added log statements when host database is read-only. X-Git-Tag: trac4631_base~9^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9a2d3637a3b1378471c30066ffac758f4ed74f7;p=thirdparty%2Fkea.git [4489] Added log statements when host database is read-only. --- diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 714148548c..7bf0ba22ad 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -551,6 +551,12 @@ connection including database name and username needed to access it A debug message issued when the server is about to obtain schema version information from the MySQL hosts database. +% DHCPSRV_MYSQL_HOST_DB_READONLY MySQL host database operates in read-only mode +This informational message is issued when the user has configured the PostgreSQL +database in read-only mode. Kea will not be able to insert or modify +host reservations but will be able to retrieve existing ones and +assign them to the clients communicating with the server. + % DHCPSRV_MYSQL_ROLLBACK rolling back MySQL database The code has issued a rollback call. All outstanding transaction will be rolled back and not committed to the database. @@ -696,6 +702,12 @@ V6) is about to open a PostgreSQL hosts database. The parameters of the connection including database name and username needed to access it (but not the password if any) are logged. +% DHCPSRV_PGSQL_HOST_DB_READONLY PostgreSQL host database operates in read-only mode +This informational message is issued when the user has configured the PostgreSQL +database in read-only mode. Kea will not be able to insert or modify +host reservations but will be able to retrieve existing ones and +assign them to the clients communicating with the server. + % DHCPSRV_PGSQL_ROLLBACK rolling back PostgreSQL database The code has issued a rollback call. All outstanding transaction will be rolled back and not committed to the database. diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index 0b98fdbfb1..30d40624c5 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@ -2013,6 +2013,8 @@ MySqlHostDataSourceImpl(const MySqlConnection::ParameterMap& parameters) conn_.prepareStatements(tagged_statements.begin() + WRITE_STMTS_BEGIN, tagged_statements.end(), tagged_statements.size()); + } else { + LOG_INFO(dhcpsrv_logger, DHCPSRV_MYSQL_HOST_DB_READONLY); } } diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/dhcpsrv/pgsql_host_data_source.cc index 5fac1830a6..d134d3c766 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/dhcpsrv/pgsql_host_data_source.cc @@ -1511,6 +1511,9 @@ PgSqlHostDataSourceImpl(const PgSqlConnection::ParameterMap& parameters) if (!is_readonly_) { conn_.prepareStatements(tagged_statements.begin() + WRITE_STMTS_BEGIN, tagged_statements.end()); + + } else { + LOG_INFO(dhcpsrv_logger, DHCPSRV_PGSQL_HOST_DB_READONLY); } }