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