Commit 2e0c1e9f authored by Yann KAISER's avatar Yann KAISER

Added oneflow_host to config.json

parent 7969105d
......@@ -75,6 +75,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
var endpoint = ""
var username = ""
var passwd = ""
var oneflowHostStr = ""
var configJSON map[string]interface{}
......@@ -112,9 +113,11 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
passwd = splittedContent[1]
}
var oneflowHost string
if v, ok := d.GetOk("oneflow_host"); ok {
oneflowHost = v.(string)
oneflowHost, okOneflowHost := d.GetOk("oneflow_host")
if okOneflowHost {
oneflowHostStr = oneflowHost.(string)
} else {
oneflowHostStr = configJSON["oneflow_host"].(string)
}
var vmTimeout = 60
......@@ -122,7 +125,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
vmTimeout = v.(int)
}
config := CreateConfig(endpoint, username, passwd, oneflowHost, vmTimeout)
config := CreateConfig(endpoint, username, passwd, oneflowHostStr, vmTimeout)
// Return new client
return config.Client()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment