Only render dhcp if set to True
This commit is contained in:
parent
0c8deeece4
commit
ade3c8b93d
|
@ -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']
|
||||
|
||||
|
|
Loading…
Reference in New Issue