Commit 0c0107ee authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2023] Change back ZONE_NEW_DATA_READY_CMD to 'zone_new_data_ready'

It used to be 'zone_new_data_ready' originally, but got changed to
'notify' some time back.
parent 82706fc5
......@@ -26,6 +26,7 @@ from isc.config.config_data import ConfigData
from isc.config.ccsession import create_answer, ModuleCCSessionError
from isc.config.module_spec import ModuleSpecError
from isc.server_common.dns_tcp import DNSTCPContext
from isc.notify import notify_out
import ddns
import errno
import os
......@@ -1163,7 +1164,7 @@ class TestDDNSSession(unittest.TestCase):
sent_msg, sent_group = self.__cc_session._sent_msg[msg_cnt]
sent_cmd = sent_msg['command']
self.assertEqual('Xfrout', sent_group)
self.assertEqual('notify', sent_cmd[0])
self.assertEqual(notify_out.ZONE_NEW_DATA_READY_CMD, sent_cmd[0])
self.assertEqual(2, len(sent_cmd[1]))
self.assertEqual(TEST_ZONE_NAME.to_text(), sent_cmd[1]['zone_name'])
self.assertEqual(TEST_RRCLASS.to_text(), sent_cmd[1]['zone_class'])
......
......@@ -21,6 +21,7 @@ import os
import tempfile
from zonemgr import *
from isc.testutils.ccsession_mock import MockModuleCCSession
from isc.notify import notify_out
ZONE_NAME_CLASS1_IN = ("example.net.", "IN")
ZONE_NAME_CLASS1_CH = ("example.net.", "CH")
......@@ -683,7 +684,7 @@ class TestZonemgr(unittest.TestCase):
self.assertEqual(answer1, self.zonemgr._parse_cmd_params(params1, ZONE_NOTIFY_COMMAND))
params2 = {"zone_name" : "example.com.", "zone_class" : "IN"}
answer2 = ZONE_NAME_CLASS3_IN
self.assertEqual(answer2, self.zonemgr._parse_cmd_params(params2, ZONE_XFRIN_SUCCESS_COMMAND))
self.assertEqual(answer2, self.zonemgr._parse_cmd_params(params2, notify_out.ZONE_NEW_DATA_READY_CMD))
self.assertRaises(ZonemgrException, self.zonemgr._parse_cmd_params, params2, ZONE_NOTIFY_COMMAND)
params1 = {"zone_class" : "CH"}
self.assertRaises(ZonemgrException, self.zonemgr._parse_cmd_params, params2, ZONE_NOTIFY_COMMAND)
......
......@@ -39,6 +39,7 @@ from optparse import OptionParser, OptionValueError
from isc.config.ccsession import *
import isc.util.process
from isc.log_messages.zonemgr_messages import *
from isc.notify import notify_out
# Initialize logging for called modules.
isc.log.init("b10-zonemgr")
......@@ -79,7 +80,6 @@ AUTH_MODULE_NAME = 'Auth'
# define command name
ZONE_XFRIN_FAILED_COMMAND = 'zone_xfrin_failed'
ZONE_XFRIN_SUCCESS_COMMAND = 'zone_new_data_ready'
ZONE_REFRESH_COMMAND = 'refresh_from_zonemgr'
ZONE_NOTIFY_COMMAND = 'notify'
......@@ -621,7 +621,7 @@ class Zonemgr:
def command_handler(self, command, args):
"""Handle command receivd from command channel.
ZONE_NOTIFY_COMMAND is issued by Auth process;
ZONE_XFRIN_SUCCESS_COMMAND and ZONE_XFRIN_FAILED_COMMAND are issued by
ZONE_NEW_DATA_READY_CMD and ZONE_XFRIN_FAILED_COMMAND are issued by
Xfrin process;
shutdown is issued by a user or Boss process. """
answer = create_answer(0)
......@@ -635,7 +635,7 @@ class Zonemgr:
# Send notification to zonemgr timer thread
self._master_socket.send(b" ")# make self._slave_socket readble
elif command == ZONE_XFRIN_SUCCESS_COMMAND:
elif command == notify_out.ZONE_NEW_DATA_READY_CMD:
""" Handle xfrin success command"""
zone_name_class = self._parse_cmd_params(args, command)
logger.debug(DBG_ZONEMGR_COMMAND, ZONEMGR_RECEIVE_XFRIN_SUCCESS, zone_name_class[0], zone_name_class[1])
......
......@@ -34,7 +34,7 @@ logger = isc.log.Logger("notify_out")
# initialized yet. see trac ticket #1103
from isc.dns import *
ZONE_NEW_DATA_READY_CMD = 'notify'
ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
_MAX_NOTIFY_NUM = 30
_MAX_NOTIFY_TRY_NUM = 5
_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