From c8132752efea22b4a902f6b503787c3fb0313e0a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 14 Apr 2015 12:32:33 +0000 Subject: [PATCH] zone: Make zone_config_{read,write} behave the same as zone_port_{read,write} do --- src/functions/functions.zone | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 6373ec7c..4874f388 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -1008,25 +1008,38 @@ function zone_settings_get() { } function zone_config_settings_read() { - assert [ $# -gt 2 ] + assert [ $# -ge 2 ] local zone="${1}" local config="${2}" shift 2 + local args + if [ $# -eq 0 ] && [ -n "${HOOK_CONFIG_SETTINGS}" ]; then + list_append args ${HOOK_CONFIG_SETTINGS} + else + list_append args $@ + fi + local path="$(zone_dir "${zone}")/configs/${config}" - settings_read "${path}" "$@" + settings_read "${path}" ${args} } function zone_config_settings_write() { - assert [ $# -gt 2 ] + assert [ $# -ge 2 ] local zone="${1}" local config="${2}" shift 2 + local args + if function_exists "hook_check_config_settings"; then + list_append args "--check=\"hook_check_config_settings\"" + fi + list_append args ${HOOK_CONFIG_SETTINGS} + local path="$(zone_dir "${zone}")/configs/${config}" - settings_write "${path}" "$@" + settings_write "${path}" ${args} } function zone_port_settings_read() { -- 2.39.2