From ade3c8b93dc03458cfcf66b0733e2c907a2cec37 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Tue, 16 Aug 2016 22:23:39 -0400 Subject: [PATCH] Only render dhcp if set to True --- subiquitycore/models/network.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subiquitycore/models/network.py b/subiquitycore/models/network.py index 25c6e7cd..0371adcf 100644 --- a/subiquitycore/models/network.py +++ b/subiquitycore/models/network.py @@ -100,12 +100,15 @@ class Networkdev(): log.debug("render to YAML") result = { self.ifname: { - 'dhcp4': self.dhcp4, - 'dhcp6': self.dhcp6, 'addresses': self.ipv4_addresses + self.ipv6_addresses, } } + if self.dhcp4: + result[self.ifname]['dhcp4'] = True + if self.dhcp6: + result[self.ifname]['dhcp6'] = True + if self.iftype == 'bond': result[self.ifname]['interfaces'] = self.probe_info.bond['slaves']