Browse Source

[trac764] second round of review

Jelte Jansen 14 years ago
parent
commit
0dd272381b

+ 1 - 1
src/lib/log/compiler/message.cc

@@ -60,7 +60,7 @@ static const char* VERSION = "1.0-0";
 ///
 ///
 /// It reads the message file and writes out two files of the same
 /// It reads the message file and writes out two files of the same
 /// name in the current working directory (unless -d is used) but
 /// name in the current working directory (unless -d is used) but
-/// with extensions of .h and .cc.
+/// with extensions of .h and .cc, or .py if -p is used.
 ///
 ///
 /// -v causes it to print the version number and exit. -h prints a help
 /// -v causes it to print the version number and exit. -h prints a help
 /// message (and exits). -p sets the output to python. -d <dir> will make
 /// message (and exits). -p sets the output to python. -d <dir> will make

+ 7 - 6
src/lib/python/isc/notify/notify_out.py

@@ -27,10 +27,11 @@ from notify_out_messages import *
 
 
 logger = isc.log.Logger("notify_out")
 logger = isc.log.Logger("notify_out")
 
 
-try:
-    from pydnspp import *
-except ImportError as e:
-    logger.error(NOTIFY_OUT_IMPORT_ERROR, str(e))
+# there used to be a printed message if this import failed, but if
+# we can't import we should not start anyway, and logging an error
+# is a bad idea since the logging system is most likely not
+# initialized yet. see trac ticket #1103
+from pydnspp import *
 
 
 ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
 ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
 _MAX_NOTIFY_NUM = 30
 _MAX_NOTIFY_NUM = 30
@@ -372,8 +373,8 @@ class NotifyOut:
         if tgt:
         if tgt:
             zone_notify_info.notify_try_num += 1
             zone_notify_info.notify_try_num += 1
             if zone_notify_info.notify_try_num > _MAX_NOTIFY_TRY_NUM:
             if zone_notify_info.notify_try_num > _MAX_NOTIFY_TRY_NUM:
-                logger.error(NOTIFY_OUT_RETRY_EXCEEDED, tgt[0], tgt[1],
-                             _MAX_NOTIFY_TRY_NUM)
+                logger.warn(NOTIFY_OUT_RETRY_EXCEEDED, tgt[0], tgt[1],
+                            _MAX_NOTIFY_TRY_NUM)
                 self._notify_next_target(zone_notify_info)
                 self._notify_next_target(zone_notify_info)
             else:
             else:
                 # set exponential backoff according rfc1996 section 3.6
                 # set exponential backoff according rfc1996 section 3.6

+ 5 - 8
src/lib/python/isc/notify/notify_out_messages.mes

@@ -15,13 +15,6 @@
 # No namespace declaration - these constants go in the global namespace
 # No namespace declaration - these constants go in the global namespace
 # of the notify_out_messages python module.
 # of the notify_out_messages python module.
 
 
-% NOTIFY_OUT_IMPORT_ERROR error importing python module: %1
-There was an error importing a python module. One of the modules
-needed by notify_out could not be found. This suggests that either
-some libraries are missing on the system, or the PYTHONPATH variable
-is not correct. The specific place where this library needs to be
-depends on your system and your specific installation.
-
 % NOTIFY_OUT_INVALID_ADDRESS invalid address %1#%2: %3
 % NOTIFY_OUT_INVALID_ADDRESS invalid address %1#%2: %3
 The notify_out library tried to send a notify message to the given
 The notify_out library tried to send a notify message to the given
 address, but it appears to be an invalid address. The configuration
 address, but it appears to be an invalid address. The configuration
@@ -52,6 +45,8 @@ be sent to this server for this notification event.
 % NOTIFY_OUT_REPLY_QR_NOT_SET QR flags set to 0 in reply to notify from %1#%2
 % NOTIFY_OUT_REPLY_QR_NOT_SET QR flags set to 0 in reply to notify from %1#%2
 The notify_out library sent a notify message to the namesever at the
 The notify_out library sent a notify message to the namesever at the
 given address, but the reply did not have the QR bit set to one.
 given address, but the reply did not have the QR bit set to one.
+Since there was a response, no more notifies will be sent to this
+server for this notification event.
 
 
 % NOTIFY_OUT_RETRY_EXCEEDED notify to %1#%2: number of retries (%3) exceeded
 % NOTIFY_OUT_RETRY_EXCEEDED notify to %1#%2: number of retries (%3) exceeded
 The maximum number of retries for the notify target has been exceeded.
 The maximum number of retries for the notify target has been exceeded.
@@ -83,4 +78,6 @@ message, either in the message parser, or while trying to extract data
 from the parsed message. The error is printed, and notify_out will
 from the parsed message. The error is printed, and notify_out will
 treat the response as a bad message, but this does point to a
 treat the response as a bad message, but this does point to a
 programming error, since all exceptions should have been caught
 programming error, since all exceptions should have been caught
-explicitely. Please file a bug report.
+explicitely. Please file a bug report. Since there was a response,
+no more notifies will be sent to this server for this notification
+event.