Persisting bond options to the netdev file, and updating the test.
This commit is contained in:
parent
41289286ca
commit
081f77a102
@ -130,7 +130,17 @@ type bondInterface struct {
|
||||
}
|
||||
|
||||
func (b *bondInterface) Netdev() string {
|
||||
return fmt.Sprintf("[NetDev]\nKind=bond\nName=%s\n", b.name)
|
||||
config := fmt.Sprintf("[NetDev]\nKind=bond\nName=%s\n", b.name)
|
||||
if b.hwaddr != nil {
|
||||
config += fmt.Sprintf("MACAddress=%s\n", b.hwaddr.String())
|
||||
}
|
||||
|
||||
config += fmt.Sprintf("\n[Bond]\n")
|
||||
for _, name := range sortedKeys(b.options) {
|
||||
config += fmt.Sprintf("%s=%s\n", name, b.options[name])
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
func (b *bondInterface) Type() string {
|
||||
|
@ -52,7 +52,7 @@ func TestInterfaceGenerators(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "testname",
|
||||
netdev: "[NetDev]\nKind=bond\nName=testname\n",
|
||||
netdev: "[NetDev]\nKind=bond\nName=testname\n\n[Bond]\n",
|
||||
network: "[Match]\nName=testname\n\n[Network]\nBond=testbond1\nVLAN=testvlan1\nVLAN=testvlan2\nDHCP=true\n",
|
||||
kind: "bond",
|
||||
iface: &bondInterface{logicalInterface: logicalInterface{
|
||||
|
Loading…
x
Reference in New Issue
Block a user