config-set problem with output_options in loggers
Affects versions: 2.4.0, 2.6.0 (I did not test other versions)
Sending config-set sending a configuration that has output_options in the "loggers" section causes the the entire output_options section to disappear from the "loggers" configuration.
Steps to reproduce:
- Start with a simple configuration
The simple configuration
{
"Dhcp4": {
"control-socket": {
"socket-name": "/tmp/socket-dhcp4",
"socket-type": "unix"
},
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "/var/log/kea/kea-dhcp4.log",
"maxsize": 1073741824,
"maxver": 5
}
],
"severity": "DEBUG",
"debuglevel": 99
}
]
}
}
- Send the same or a modified configuration with
config-set
(the loggers section unchanged). Note that logging to the file stops.
a slightly different configuration sent
{
"command": "config-set",
"arguments": {
"Dhcp4": {
"control-socket": {
"socket-name": "/tmp/socket-dhcp4",
"socket-type": "unix"
},
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "/var/log/kea/kea-dhcp4.log",
"maxsize": 1073741824,
"maxver": 5
}
],
"severity": "DEBUG",
"debuglevel": 99
}
]
}
}
}
- Now send a
config-get
and notice that theoutput_options
section is gone:
result of config-get
{
"arguments": {
"Dhcp4": {
"allocator": "iterative",
"authoritative": false,
"boot-file-name": "",
"calculate-tee-times": true,
"control-socket": {
"socket-name": "/tmp/socket-dhcp4",
"socket-type": "unix"
},
"ddns-conflict-resolution-mode": "check-with-dhcid",
"ddns-generated-prefix": "myhost",
"ddns-override-client-update": false,
"ddns-override-no-update": false,
"ddns-qualifying-suffix": "",
"ddns-replace-client-name": "never",
"ddns-send-updates": true,
"ddns-update-on-renew": false,
"decline-probation-period": 86400,
"dhcp-ddns": {
"enable-updates": false,
"max-queue-size": 1024,
"ncr-format": "JSON",
"ncr-protocol": "UDP",
"sender-ip": "0.0.0.0",
"sender-port": 0,
"server-ip": "127.0.0.1",
"server-port": 53001
},
"dhcp-queue-control": {
"capacity": 64,
"enable-queue": false,
"queue-type": "kea-ring4"
},
"dhcp4o6-port": 0,
"early-global-reservations-lookup": false,
"echo-client-id": true,
"expired-leases-processing": {
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"reclaim-timer-wait-time": 10,
"unwarned-reclaim-cycles": 5
},
"hooks-libraries": [],
"host-reservation-identifiers": [
"hw-address",
"duid",
"circuit-id",
"client-id"
],
"hostname-char-replacement": "",
"hostname-char-set": "[^A-Za-z0-9.-]",
"interfaces-config": {
"interfaces": [],
"re-detect": false
},
"ip-reservations-unique": true,
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp4",
"severity": "DEBUG"
}
],
"match-client-id": true,
"multi-threading": {
"enable-multi-threading": true,
"packet-queue-size": 64,
"thread-pool-size": 0
},
"next-server": "0.0.0.0",
"option-data": [],
"option-def": [],
"parked-packet-limit": 256,
"reservations-global": false,
"reservations-in-subnet": true,
"reservations-lookup-first": false,
"reservations-out-of-pool": false,
"sanity-checks": {
"extended-info-checks": "fix",
"lease-checks": "warn"
},
"server-hostname": "",
"server-tag": "",
"shared-networks": [],
"stash-agent-options": false,
"statistic-default-sample-age": 0,
"statistic-default-sample-count": 20,
"store-extended-info": false,
"subnet4": [],
"t1-percent": 0.5,
"t2-percent": 0.875,
"valid-lifetime": 7200
},
"hash": "E444209F41F22451DABB7B2EA5B0DBBF609B49392514FECDB2D5BB41A8929D4C"
},
"result": 0
}
Note that if step 2 above is repeated using output-options
instead of output_options
then the section does NOT disappear.
Further note that 2.4.0 accepts either output-options
Edited by Darren Ankney