Browse Source

[4489] Added log statements when host database is read-only.

Marcin Siodelski 8 years ago
parent
commit
d9a2d3637a

+ 12 - 0
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
 A debug message issued when the server is about to obtain schema version
 information from the MySQL hosts database.
 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
 % DHCPSRV_MYSQL_ROLLBACK rolling back MySQL database
 The code has issued a rollback call.  All outstanding transaction will
 The code has issued a rollback call.  All outstanding transaction will
 be rolled back and not committed to the database.
 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
 connection including database name and username needed to access it
 (but not the password if any) are logged.
 (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
 % DHCPSRV_PGSQL_ROLLBACK rolling back PostgreSQL database
 The code has issued a rollback call.  All outstanding transaction will
 The code has issued a rollback call.  All outstanding transaction will
 be rolled back and not committed to the database.
 be rolled back and not committed to the database.

+ 2 - 0
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,
         conn_.prepareStatements(tagged_statements.begin() + WRITE_STMTS_BEGIN,
                                 tagged_statements.end(),
                                 tagged_statements.end(),
                                 tagged_statements.size());
                                 tagged_statements.size());
+    } else {
+        LOG_INFO(dhcpsrv_logger, DHCPSRV_MYSQL_HOST_DB_READONLY);
     }
     }
 }
 }
 
 

+ 3 - 0
src/lib/dhcpsrv/pgsql_host_data_source.cc

@@ -1511,6 +1511,9 @@ PgSqlHostDataSourceImpl(const PgSqlConnection::ParameterMap& parameters)
     if (!is_readonly_) {
     if (!is_readonly_) {
         conn_.prepareStatements(tagged_statements.begin() + WRITE_STMTS_BEGIN,
         conn_.prepareStatements(tagged_statements.begin() + WRITE_STMTS_BEGIN,
                                 tagged_statements.end());
                                 tagged_statements.end());
+
+    } else {
+        LOG_INFO(dhcpsrv_logger, DHCPSRV_PGSQL_HOST_DB_READONLY);
     }
     }
 }
 }