start to deprecate dumb droplets file

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-22 18:58:47 -05:00
parent b1a943fa3d
commit e2d872f088
2 changed files with 15 additions and 2 deletions

View File

@ -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() {

View File

@ -30,7 +30,7 @@ func main() {
}
readConfigFile()
readDropletFile("droplets")
// readDropletFile("droplets")
readHypervisorFile("hypervisor")
writeConfigFile()