CORD-1506 Update fabric config generator to ONOS 1.10 format.
Change-Id: I7eaa620d4a651028e5fb1572bf91d314aed11112
diff --git a/config-generator/handlers.go b/config-generator/handlers.go
index dc5b34b..a12da98 100644
--- a/config-generator/handlers.go
+++ b/config-generator/handlers.go
@@ -74,7 +74,7 @@
// If the request specified the number of hosts, validate we have that
// exact number
if options.HostCount > 0 && len(hosts.Hosts) != options.HostCount {
- log.Errorf("Expecting %d host(s), found %d, no configuration generaged",
+ log.Errorf("Expecting %d host(s), found %d, no configuration generated",
options.HostCount, len(hosts.Hosts))
http.Error(w, "Expected host count mismatch",
http.StatusInternalServerError)
@@ -108,6 +108,13 @@
return "0.0.0.254/24"
}
},
+ "vlan": func(ips []string) string {
+ if (len(ips) > 0) {
+ return strings.Split(ips[0], ".")[2]
+ } else {
+ return "0"
+ }
+ },
}
tpl, err := template.New("netconfig.tpl").Funcs(funcMap).ParseFiles("netconfig.tpl")