summaryrefslogtreecommitdiff
path: root/validate.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-16 05:21:44 -0600
committerJeff Carr <[email protected]>2024-11-16 05:21:44 -0600
commit70cc9944adfea53e1c5a841d573cac79a5b94ce9 (patch)
tree8b980ddd002628c5c7290a94bfdaa0b5a80974e8 /validate.go
parent5ea2e5999bf19c5b0dcd594ce5c646ae2227fcec (diff)
create and start work againv0.2.16v0.2.15v0.2.14
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'validate.go')
-rw-r--r--validate.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/validate.go b/validate.go
index b6572f5..6ea8aba 100644
--- a/validate.go
+++ b/validate.go
@@ -198,8 +198,10 @@ func getNewMac() string {
return ""
}
+// consistancy check. run on a regular basis
+//
// runs on startup. dies if there are duplicates
-// the config file must then be edited by hand
+// the config file must then be edited by hand for now
func ValidateDroplets() (map[string]string, map[string]string, error) {
// uuid map to check for duplicates
var umap map[string]string
@@ -301,6 +303,14 @@ func ValidateDroplet(check *pb.Droplet) error {
// check for duplicate mac addresses
for _, checkn := range check.Networks {
+ log.Info("found mac = ", checkn.Mac, check.Hostname)
+ if checkn.Mac == "" {
+ checkn.Mac = getNewMac()
+ if err := me.cluster.ConfigSave(); err != nil {
+ log.Info("configsave error", err)
+ os.Exit(-1)
+ }
+ }
loop := me.cluster.DropletsAll() // get the list of droplets
for loop.Scan() {
d := loop.Droplet()