diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-16 12:14:43 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-16 12:14:43 +0200 |
commit | cb014d8818a864512680f57953d6f21ad5467e59 (patch) | |
tree | 033db927a4843cdc7ad3b993bb013d94e18d40c3 /src | |
parent | 67fa67af916df1cf388af5ef1f1f7a9fd7a81bdb (diff) | |
download | vyos-1x-cb014d8818a864512680f57953d6f21ad5467e59.tar.gz vyos-1x-cb014d8818a864512680f57953d6f21ad5467e59.zip |
dhcp(v6)-relay: T4353: fix Jinja2 linting errors
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dhcp_relay.py | 7 | ||||
-rwxr-xr-x | src/conf_mode/dhcpv6_relay.py | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/conf_mode/dhcp_relay.py b/src/conf_mode/dhcp_relay.py index 6352e0b4a..4de2ca2f3 100755 --- a/src/conf_mode/dhcp_relay.py +++ b/src/conf_mode/dhcp_relay.py @@ -66,18 +66,19 @@ def generate(relay): if not relay: return None - render(config_file, 'dhcp-relay/dhcrelay.conf.tmpl', relay) + render(config_file, 'dhcp-relay/dhcrelay.conf.j2', relay) return None def apply(relay): # bail out early - looks like removal from running config + service_name = 'isc-dhcp-relay.service' if not relay: - call('systemctl stop isc-dhcp-relay.service') + call(f'systemctl stop {service_name}') if os.path.exists(config_file): os.unlink(config_file) return None - call('systemctl restart isc-dhcp-relay.service') + call(f'systemctl restart {service_name}') return None diff --git a/src/conf_mode/dhcpv6_relay.py b/src/conf_mode/dhcpv6_relay.py index aea2c3b73..c1bd51f62 100755 --- a/src/conf_mode/dhcpv6_relay.py +++ b/src/conf_mode/dhcpv6_relay.py @@ -82,19 +82,20 @@ def generate(relay): if not relay: return None - render(config_file, 'dhcp-relay/dhcrelay6.conf.tmpl', relay) + render(config_file, 'dhcp-relay/dhcrelay6.conf.j2', relay) return None def apply(relay): # bail out early - looks like removal from running config + service_name = 'isc-dhcp-relay6.service' if not relay: # DHCPv6 relay support is removed in the commit - call('systemctl stop isc-dhcp-relay6.service') + call(f'systemctl stop {service_name}') if os.path.exists(config_file): os.unlink(config_file) return None - call('systemctl restart isc-dhcp-relay6.service') + call(f'systemctl restart {service_name}') return None |