summaryrefslogtreecommitdiff
path: root/configfiles.go
diff options
context:
space:
mode:
Diffstat (limited to 'configfiles.go')
-rw-r--r--configfiles.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/configfiles.go b/configfiles.go
index b23cb0d..1bdf153 100644
--- a/configfiles.go
+++ b/configfiles.go
@@ -32,13 +32,16 @@ func readDropletFile(filename string) {
// this is a new unknown droplet (not in the config file)
d = new(DropletT)
d.Hostname = name
- if len(fields) < 2 || fields[1] != "ON" {
+ if len(fields) > 1 && fields[1] != "ON" {
d.State = "OFF"
} else {
d.State = "ON"
}
+ if len(fields) >= 3 {
+ d.hyperPreferred = fields[2]
+ }
me.droplets = append(me.droplets, d)
- log.Log(EVENT, "NEW CONFIG DROPLET", d.Hostname, d.State)
+ log.Log(EVENT, "NEW CONFIG DROPLET", d.Hostname, d.State, d.hyperPreferred)
} else {
log.Info("not sure what to do here. duplicate droplet", name, "in config file")
}