Browse Source

[3601] More review comments

Minor log message and comment wording
Thomas Markwalder 9 years ago
parent
commit
71e6ef8777

+ 2 - 2
src/lib/dhcpsrv/dhcpsrv_messages.mes

@@ -359,7 +359,7 @@ timer used for lease file cleanup scheduling. This is highly unlikely
 and indicates programming error. The message include the reason for this
 error.
 
-% DHCPSRV_MEMFILE_NEEDS_DOWNGRADING schema of lease file: %1 is later than version %2.
+% DHCPSRV_MEMFILE_NEEDS_DOWNGRADING version of lease file: %1 schema is later than version %2.
 A warning message issued when the schema of the lease file loaded by the server
 is newer than the memfile schema of the server.  The server converts the lease
 data from newer schemas to its schema as it is read, therefore the lease
@@ -367,7 +367,7 @@ information in use by the server will be correct. Note though, that any data
 data stored in newer schema fields will be dropped.  What remains is for the
 file itself to be rewritten using the current schema.
 
-% DHCPSRV_MEMFILE_NEEDS_UPGRADING schema of lease file: %1 is at version %2.
+% DHCPSRV_MEMFILE_NEEDS_UPGRADING version of lease file: %1 schema is earlier than version %2.
 A warning message issued when the schema of the lease file loaded by the server
 pre-dates the memfile schema of the server.  Note that the server converts the
 lease data from older schemas to the current schema as it is read, therefore

+ 1 - 1
src/lib/dhcpsrv/lease_file_loader.h

@@ -161,7 +161,7 @@ public:
                       ?  DHCPSRV_MEMFILE_NEEDS_UPGRADING
                       : DHCPSRV_MEMFILE_NEEDS_DOWNGRADING))
                      .arg(lease_file.getFilename())
-                     .arg(lease_file.getInputSchemaState());
+                     .arg(lease_file.getSchemaVersion());
         }
 
         if (close_file_on_exit) {

+ 6 - 3
src/lib/util/versioned_csv_file.cc

@@ -145,8 +145,10 @@ VersionedCSVFile::next(CSVRow& row) {
             break;
 
         case NEEDS_UPGRADE:
-            // Rows must be at least as long as header but not longer
-            // than the current schema
+            // The input header met the minimum column count but
+            // is less than the current schema so:
+            // Rows must not be shorter than the valid column count
+            // and not longer than the current schema
             if (row.getValuesCount() < getValidColumnCount()) {
                 columnCountError(row, "too few columns to upgrade");
                 row_valid = false;
@@ -163,7 +165,8 @@ VersionedCSVFile::next(CSVRow& row) {
             break;
 
         case NEEDS_DOWNGRADE:
-            // Rows may be as long as header but not shorter than
+            // The input header exceeded current schema so:
+            // Rows may be as long as input header but not shorter than
             // the the current schema
             if (row.getValuesCount() < getColumnCount()) {
                 columnCountError(row, "too few columns to downgrade");