CORD-229 - updated to implement initial base switch provisioning
Change-Id: I3deca583dc2753e1a2c77629f1ee45f8b66223c8
diff --git a/provisioner/handlers.go b/provisioner/handlers.go
index 6a7bb01..32812da 100644
--- a/provisioner/handlers.go
+++ b/provisioner/handlers.go
@@ -76,7 +76,13 @@
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
- err = c.dispatcher.Dispatch(&info, role, c.config.Script)
+
+ // If the request has a script set, override the default configuration
+ script := c.config.Script
+ if info.Script != "" {
+ script = info.Script
+ }
+ err = c.dispatcher.Dispatch(&info, role, script)
if err != nil {
log.Printf("[errpr] unable to dispatch provisioning request for node '%s' : %s", info.Name, err)
http.Error(w, err.Error(), http.StatusInternalServerError)