summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configfiles.go15
-rw-r--r--main.go2
2 files changed, 15 insertions, 2 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() {
diff --git a/main.go b/main.go
index 3bd152a..d796946 100644
--- a/main.go
+++ b/main.go
@@ -30,7 +30,7 @@ func main() {
}
readConfigFile()
- readDropletFile("droplets")
+ // readDropletFile("droplets")
readHypervisorFile("hypervisor")
writeConfigFile()