summaryrefslogtreecommitdiff
path: root/cloudinit/net/openbsd.py
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2021-05-14 15:58:47 -0400
committerGitHub <noreply@github.com>2021-05-14 14:58:47 -0500
commit6fe1983777663a1a1136fd73dc50244f2d030be8 (patch)
treefa70e1a8575daf9b1e55285d6106d9bb4050c865 /cloudinit/net/openbsd.py
parent4c3c36297ad199ee9325a48f7e56a9c099ec183f (diff)
downloadvyos-cloud-init-6fe1983777663a1a1136fd73dc50244f2d030be8.tar.gz
vyos-cloud-init-6fe1983777663a1a1136fd73dc50244f2d030be8.zip
BSD: static network, set the mtu (#894)
In the case of a static network, we now set the MTU according to the meta-data.
Diffstat (limited to 'cloudinit/net/openbsd.py')
-rw-r--r--cloudinit/net/openbsd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/net/openbsd.py b/cloudinit/net/openbsd.py
index 166d77e6..9ec7ee9e 100644
--- a/cloudinit/net/openbsd.py
+++ b/cloudinit/net/openbsd.py
@@ -18,7 +18,7 @@ class Renderer(cloudinit.net.bsd.BSDRenderer):
content = 'dhcp\n'
elif isinstance(v, dict):
try:
- content = "inet {address} {netmask}\n".format(
+ content = "inet {address} {netmask}".format(
address=v['address'],
netmask=v['netmask']
)
@@ -26,6 +26,10 @@ class Renderer(cloudinit.net.bsd.BSDRenderer):
LOG.error(
"Invalid static configuration for %s",
device_name)
+ mtu = v.get("mtu")
+ if mtu:
+ content += (' mtu %d' % mtu)
+ content += "\n"
util.write_file(fn, content)
def start_services(self, run=False):