Commit fa081c17 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

use the sequence number to get the right answer in cfgmgr and ccsession.py...

use the sequence number to get the right answer in cfgmgr and ccsession.py (and hence in modules) too 


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1449 e5f2f494-b856-4b98-b285-d166d9295462
parent ecac16e6
......@@ -249,8 +249,8 @@ class ModuleCCSession(ConfigData):
self._session.group_subscribe(module_name);
# Get the current config for that module now
self._session.group_sendmsg({ "command": [ "get_config", { "module_name": module_name } ] }, "ConfigManager")
answer, env = self._session.group_recvmsg(False)
seq = self._session.group_sendmsg({ "command": [ "get_config", { "module_name": module_name } ] }, "ConfigManager")
answer, env = self._session.group_recvmsg(False, seq)
if answer:
rcode, value = parse_answer(answer)
if rcode == 0:
......@@ -279,14 +279,14 @@ class ModuleCCSession(ConfigData):
def __send_spec(self):
"""Sends the data specification to the configuration manager"""
msg = create_command(COMMAND_MODULE_SPEC, self.get_module_spec().get_full_spec())
self._session.group_sendmsg(msg, "ConfigManager")
answer, env = self._session.group_recvmsg(False)
seq = self._session.group_sendmsg(msg, "ConfigManager")
answer, env = self._session.group_recvmsg(False, seq)
def __request_config(self):
"""Asks the configuration manager for the current configuration, and call the config handler if set.
Raises a ModuleCCSessionError if there is no answer from the configuration manager"""
self._session.group_sendmsg({ "command": [ "get_config", { "module_name": self._module_name } ] }, "ConfigManager")
answer, env = self._session.group_recvmsg(False)
seq = self._session.group_sendmsg({ "command": [ "get_config", { "module_name": self._module_name } ] }, "ConfigManager")
answer, env = self._session.group_recvmsg(False, seq)
if answer:
rcode, value = parse_answer(answer)
if rcode == 0:
......
......@@ -244,16 +244,16 @@ class ConfigManager:
if conf_part:
data.merge(conf_part, cmd[1])
update_cmd = isc.config.ccsession.create_command(isc.config.ccsession.COMMAND_CONFIG_UPDATE, conf_part)
self.cc.group_sendmsg(update_cmd, module_name)
answer, env = self.cc.group_recvmsg(False)
seq = self.cc.group_sendmsg(update_cmd, module_name)
answer, env = self.cc.group_recvmsg(False, seq)
else:
conf_part = data.set(self.config.data, module_name, {})
data.merge(conf_part[module_name], cmd[1])
# send out changed info
update_cmd = isc.config.ccsession.create_command(isc.config.ccsession.COMMAND_CONFIG_UPDATE, conf_part[module_name])
self.cc.group_sendmsg(update_cmd, module_name)
seq = self.cc.group_sendmsg(update_cmd, module_name)
# replace 'our' answer with that of the module
answer, env = self.cc.group_recvmsg(False)
answer, env = self.cc.group_recvmsg(False, seq)
if answer:
rcode, val = isc.config.ccsession.parse_answer(answer)
if rcode == 0:
......@@ -269,8 +269,8 @@ class ConfigManager:
for module in self.config.data:
if module != "version" and (module not in old_data or self.config.data[module] != old_data[module]):
update_cmd = isc.config.ccsession.create_command(isc.config.ccsession.COMMAND_CONFIG_UPDATE, self.config.data[module])
self.cc.group_sendmsg(update_cmd, module)
answer, env = self.cc.group_recvmsg(False)
seq = self.cc.group_sendmsg(update_cmd, module)
answer, env = self.cc.group_recvmsg(False, seq)
if answer == None:
got_error = True
err_list.append("No answer message from " + module)
......
Markdown is supported
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