2015-03-02 15:03:21 -08:00
|
|
|
package network
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
log "github.com/Sirupsen/logrus"
|
|
|
|
|
2015-07-29 00:45:06 -07:00
|
|
|
"github.com/rancher/netconf"
|
2015-03-02 15:03:21 -08:00
|
|
|
"github.com/rancherio/os/config"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Main() {
|
|
|
|
args := os.Args
|
|
|
|
if len(args) > 1 {
|
2015-07-29 11:52:15 +05:00
|
|
|
fmt.Println("call " + args[0] + " to load network config from cloud-config.yml")
|
2015-03-02 15:03:21 -08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
cfg, err := config.LoadConfig()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2015-07-29 00:45:06 -07:00
|
|
|
if err := netconf.ApplyNetworkConfigs(&cfg.Rancher.Network); err != nil {
|
|
|
|
log.Fatal(err)
|
2015-03-02 15:03:21 -08:00
|
|
|
}
|
|
|
|
}
|