summaryrefslogtreecommitdiff
path: root/configfiles.go
diff options
context:
space:
mode:
Diffstat (limited to 'configfiles.go')
-rw-r--r--configfiles.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/configfiles.go b/configfiles.go
index fbaee5a..cda724d 100644
--- a/configfiles.go
+++ b/configfiles.go
@@ -22,9 +22,22 @@ func readConfigFile() {
}
err = me.cluster.UnmarshalJSON(pfile)
if err != nil {
- log.Info("create json failed", err)
+ log.Info("read json failed", err)
+ os.Exit(-1)
return
}
+ for _, pbd := range me.cluster.Droplets {
+ d := findDroplet(pbd.Hostname)
+ if d != nil {
+ continue
+ }
+ // this is a new unknown droplet (not in the config file)
+ d = new(DropletT)
+ d.pb = pbd
+ me.droplets = append(me.droplets, d)
+ log.Log(EVENT, "config new droplet", d.pb.Hostname, d.pb.StartState, d.pb.PreferredHypervisor)
+ }
+
}
func writeConfigFile() {