From 993c2975141a255ca7dece41bbaf4271ae264515 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 8 Mar 2019 20:23:01 +0100 Subject: T103: [dhcp-server] beautify generated configuration file --- src/conf_mode/dhcp_server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index 22ada72a8..12d138218 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -104,7 +104,9 @@ failover peer "{{ subnet.failover_name }}" { {% for network in shared_network %} {%- if not network.disabled -%} shared-network {{ network.name }} { - {{ "authoritative;" if network.authoritative }} + {%- if network.authoritative %} + authoritative; + {%- endif %} {%- if network.network_parameters %} # The following {{ network.network_parameters | length }} line(s) were added as shared-network-parameters in the CLI and have not been validated {%- for param in network.network_parameters %} @@ -216,7 +218,7 @@ shared-network {{ network.name }} { set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)); set ClientDomain = pick-first-value(config-option domain-name, "..YYZ!"); execute("/usr/libexec/vyos/system/on-dhcp-event.sh", "commit", ClientName, ClientIp, ClientMac, ClientDomain); - {% endif -%} + {%- endif %} } } {%- endif %} -- cgit v1.2.3