From 2c0438adf459c2010e0e91fbf9615d9d201106fe Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 1 Aug 2024 10:10:34 +0200 Subject: [PATCH] rename are_dns_bound to is_dns_bound --- imageroot/actions/configure-module/10validate | 4 ++-- imageroot/actions/get-configuration/10get | 2 +- .../actions/get-configuration/validate-output.json | 4 ++-- ui/src/views/Settings.vue | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/imageroot/actions/configure-module/10validate b/imageroot/actions/configure-module/10validate index a1cca3e..2855957 100755 --- a/imageroot/actions/configure-module/10validate +++ b/imageroot/actions/configure-module/10validate @@ -65,12 +65,12 @@ if request["dhcp-server"]["enabled"]: sys.exit(2) if request["dns-server"]["enabled"]: - are_dns_bound = network.are_ports_53_bound() + is_dns_bound = network.are_ports_53_bound() # read config.json and determine if dns is used for this instance config = json.load(open("config.json")) is_dns_enabled = config["dns-server"]["enabled"] # check if dns is already bound to port 53 and stop the action - if are_dns_bound and not is_dns_enabled: + if is_dns_bound and not is_dns_enabled: agent.set_status('validation-failed') json.dump([{'field':'dnsEnableField', 'parameter':'dnsEnableField', 'value': request['dns-server']['enabled'], 'error':'dns_port_already_bind'}], fp=sys.stdout) sys.exit(3) diff --git a/imageroot/actions/get-configuration/10get b/imageroot/actions/get-configuration/10get index b10f0bc..1d14817 100755 --- a/imageroot/actions/get-configuration/10get +++ b/imageroot/actions/get-configuration/10get @@ -19,7 +19,7 @@ if config["interface"] != "" and config["dhcp-server"]["start"] == "" and config config["dhcp-server"]["end"] = str(interface["end"]) # we test if tcp/53 or udp/53 is bound to the interface -config["are_dns_bound"] = network.are_ports_53_bound() +config["is_dns_bound"] = network.are_ports_53_bound() # check if dnsmasq is enabled in the configuration, needed to determine in the UI if the DNS server was enabled and used by dnsmasq. # the dnsmasq service is always running, we cannot state if it is enabled/active or not. config['is_dns_enabled'] = config["dns-server"]["enabled"] diff --git a/imageroot/actions/get-configuration/validate-output.json b/imageroot/actions/get-configuration/validate-output.json index ecbf133..7dcf963 100644 --- a/imageroot/actions/get-configuration/validate-output.json +++ b/imageroot/actions/get-configuration/validate-output.json @@ -101,7 +101,7 @@ "description": "True if dnsmasq is configured", "type": "boolean" }, - "are_dns_bound": { + "is_dns_bound": { "description": "True if DNS servers are bound to the interface", "type": "boolean" } @@ -111,6 +111,6 @@ "dhcp-server", "dns-server", "is_dns_enabled", - "are_dns_bound" + "is_dns_bound" ] } diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index 55f147e..19481ef 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -163,7 +163,7 @@ {{ $t("settings.DNS_description") }} @@ -220,7 +220,7 @@ :disabled=" loading.getConfiguration || loading.configureModule || - (are_dns_bound && !dnsEnableField && !is_dns_enabled) + (is_dns_bound && !dnsEnableField && !is_dns_enabled) " >{{ $t("settings.save") }} @@ -269,7 +269,7 @@ export default { dhcpStartField: "", dhcpEndField: "", dhcpLeaseField: 12, - are_dns_bound: false, + is_dns_bound: false, is_dns_enabled: false, dnsEnableField: false, dnsPrimaryField: "", @@ -427,7 +427,7 @@ export default { this.dnsEnableField = dns_server["enabled"]; this.dnsPrimaryField = dns_server["primary-server"]; this.dnsSecondaryField = dns_server["secondary-server"]; - this.are_dns_bound = config["are_dns_bound"]; + this.is_dns_bound = config["is_dns_bound"]; this.is_dns_enabled = config["is_dns_enabled"]; }, validateConfigureModule() {