Commit cb8f6b5e authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2023] Also move ZONE_XFRIN_FAILED to a single module

parent 0c0107ee
...@@ -71,7 +71,6 @@ AUTH_MODULE_NAME = 'Auth' ...@@ -71,7 +71,6 @@ AUTH_MODULE_NAME = 'Auth'
XFROUT_MODULE_NAME = 'Xfrout' XFROUT_MODULE_NAME = 'Xfrout'
ZONE_MANAGER_MODULE_NAME = 'Zonemgr' ZONE_MANAGER_MODULE_NAME = 'Zonemgr'
REFRESH_FROM_ZONEMGR = 'refresh_from_zonemgr' REFRESH_FROM_ZONEMGR = 'refresh_from_zonemgr'
ZONE_XFRIN_FAILED = 'zone_xfrin_failed'
# Constants for debug levels. # Constants for debug levels.
DBG_XFRIN_TRACE = logger.DBGLVL_TRACE_BASIC DBG_XFRIN_TRACE = logger.DBGLVL_TRACE_BASIC
...@@ -1580,7 +1579,7 @@ class Xfrin: ...@@ -1580,7 +1579,7 @@ class Xfrin:
logger.error(XFRIN_MSGQ_SEND_ERROR, XFROUT_MODULE_NAME, ZONE_MANAGER_MODULE_NAME) logger.error(XFRIN_MSGQ_SEND_ERROR, XFROUT_MODULE_NAME, ZONE_MANAGER_MODULE_NAME)
else: else:
msg = create_command(ZONE_XFRIN_FAILED, param) msg = create_command(notify_out.ZONE_XFRIN_FAILED, param)
# catch the exception, in case msgq has been killed. # catch the exception, in case msgq has been killed.
try: try:
seq = self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME) seq = self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME)
......
...@@ -79,7 +79,6 @@ XFRIN_MODULE_NAME = 'Xfrin' ...@@ -79,7 +79,6 @@ XFRIN_MODULE_NAME = 'Xfrin'
AUTH_MODULE_NAME = 'Auth' AUTH_MODULE_NAME = 'Auth'
# define command name # define command name
ZONE_XFRIN_FAILED_COMMAND = 'zone_xfrin_failed'
ZONE_REFRESH_COMMAND = 'refresh_from_zonemgr' ZONE_REFRESH_COMMAND = 'refresh_from_zonemgr'
ZONE_NOTIFY_COMMAND = 'notify' ZONE_NOTIFY_COMMAND = 'notify'
...@@ -621,7 +620,7 @@ class Zonemgr: ...@@ -621,7 +620,7 @@ class Zonemgr:
def command_handler(self, command, args): def command_handler(self, command, args):
"""Handle command receivd from command channel. """Handle command receivd from command channel.
ZONE_NOTIFY_COMMAND is issued by Auth process; ZONE_NOTIFY_COMMAND is issued by Auth process;
ZONE_NEW_DATA_READY_CMD and ZONE_XFRIN_FAILED_COMMAND are issued by ZONE_NEW_DATA_READY_CMD and ZONE_XFRIN_FAILED are issued by
Xfrin process; Xfrin process;
shutdown is issued by a user or Boss process. """ shutdown is issued by a user or Boss process. """
answer = create_answer(0) answer = create_answer(0)
...@@ -643,7 +642,7 @@ class Zonemgr: ...@@ -643,7 +642,7 @@ class Zonemgr:
self._zone_refresh.zone_refresh_success(zone_name_class) self._zone_refresh.zone_refresh_success(zone_name_class)
self._master_socket.send(b" ")# make self._slave_socket readble self._master_socket.send(b" ")# make self._slave_socket readble
elif command == ZONE_XFRIN_FAILED_COMMAND: elif command == notify_out.ZONE_XFRIN_FAILED:
""" Handle xfrin fail command""" """ Handle xfrin fail command"""
zone_name_class = self._parse_cmd_params(args, command) zone_name_class = self._parse_cmd_params(args, command)
logger.debug(DBG_ZONEMGR_COMMAND, ZONEMGR_RECEIVE_XFRIN_FAILED, zone_name_class[0], zone_name_class[1]) logger.debug(DBG_ZONEMGR_COMMAND, ZONEMGR_RECEIVE_XFRIN_FAILED, zone_name_class[0], zone_name_class[1])
......
...@@ -35,6 +35,8 @@ logger = isc.log.Logger("notify_out") ...@@ -35,6 +35,8 @@ logger = isc.log.Logger("notify_out")
from isc.dns import * from isc.dns import *
ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready' ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
ZONE_XFRIN_FAILED = 'zone_xfrin_failed'
_MAX_NOTIFY_NUM = 30 _MAX_NOTIFY_NUM = 30
_MAX_NOTIFY_TRY_NUM = 5 _MAX_NOTIFY_TRY_NUM = 5
_EVENT_NONE = 0 _EVENT_NONE = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment