fix build

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
2015-11-09 09:08:44 +00:00
parent d407b82968
commit 414957d985
55 changed files with 35 additions and 77 deletions

View File

@@ -20,9 +20,9 @@ import (
"os/exec"
"strings"
"github.com/vishvananda/netlink"
"github.com/coreos/coreos-cloudinit/config"
"github.com/coreos/coreos-cloudinit/network"
"github.com/vishvananda/netlink"
)
func RestartNetwork(interfaces []network.InterfaceGenerator) (err error) {
@@ -56,7 +56,11 @@ func downNetworkInterfaces(interfaces []network.InterfaceGenerator) error {
for _, iface := range interfaces {
if systemInterface, ok := sysInterfaceMap[iface.Name()]; ok {
log.Printf("Taking down interface %q\n", systemInterface.Name)
if err := netlink.NetworkLinkDown(systemInterface); err != nil {
link, err := netlink.LinkByName(systemInterface.Name)
if err != nil {
log.Printf("Error while downing interface %q (%s). Continuing...\n", systemInterface.Name, err)
}
if err = netlink.LinkSetDown(link); err != nil {
log.Printf("Error while downing interface %q (%s). Continuing...\n", systemInterface.Name, err)
}
}