2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[2676] Reuse constants for remote loadzone command

This commit is contained in:
Michal 'vorner' Vaner
2013-02-19 09:50:15 +01:00
parent b459be530b
commit f29f0653f2
2 changed files with 13 additions and 7 deletions

View File

@@ -32,6 +32,8 @@ import isc.util.cio.socketsession
import isc.server_common.tsig_keyring
from isc.server_common.dns_tcp import DNSTCPContext
from isc.datasrc import DataSourceClient
from isc.server_common.auth_command import AUTH_LOADZONE_COMMAND, \
auth_loadzone_params
import select
import time
import errno
@@ -564,8 +566,8 @@ class DDNSServer:
def __notify_auth(self, zname, zclass):
'''Notify auth of the update, if necessary.'''
param = {'origin': zname.to_text(), 'class': zclass.to_text()}
self.__notify_update(AUTH_MODULE_NAME, 'loadzone', param, zname,
self.__notify_update(AUTH_MODULE_NAME, AUTH_LOADZONE_COMMAND,
auth_loadzone_params(zname, zclass), zname,
zclass)
def __notify_xfrout(self, zname, zclass):

View File

@@ -22,6 +22,13 @@ from isc.log_messages.server_common_messages import *
from isc.server_common.logger import logger
AUTH_MODULE_NAME = 'Auth'
AUTH_LOADZONE_COMMAND = 'loadzone'
def auth_loadzone_params(zone_name, zone_class):
return {
"origin": zone_name.to_text(),
"class": zone_class.to_text()
}
def auth_loadzone_command(module_cc, zone_name, zone_class):
'''Create a 'loadzone' command with a given zone for Auth server.
@@ -50,8 +57,5 @@ def auth_loadzone_command(module_cc, zone_name, zone_class):
# to notification-driven approach, at which point the function would
# be changed a lot.
param = {
"origin": zone_name.to_text(),
"class": zone_class.to_text()
}
return create_command("loadzone", param)
return create_command(AUTH_LOADZONE_COMMAND,
auth_loadzone_params(zone_name, zone_class))