func()

in whisk/wskprops.go [164:192]


func (pi PropertiesImp) GetPropsFromWskprops(path string) *Wskprops {
	dep := GetDefaultWskprops(WSKPROP)

	var wskpropsPath string
	if path != "" {
		wskpropsPath = path
	} else {
		wskpropsPath = pi.OsPackage.Getenv(HOMEPATH, "") + "/" + DEFAULT_LOCAL_CONFIG
	}
	results, err := ReadProps(wskpropsPath)

	if err == nil {

		dep.APIHost = GetValue(results, APIHOST, dep.APIHost)

		dep.AuthKey = GetValue(results, AUTH, dep.AuthKey)
		dep.Namespace = GetValue(results, NAMESPACE, dep.Namespace)
		dep.AuthAPIGWKey = GetValue(results, APIGW_ACCESS_TOKEN, dep.AuthAPIGWKey)
		dep.APIGWTenantId = GetValue(results, APIGW_TENANT_ID, dep.APIGWTenantId)
		if len(dep.AuthKey) > 0 {
			dep.APIGWSpaceSuid = strings.Split(dep.AuthKey, ":")[0]
		}
		dep.Apiversion = GetValue(results, APIVERSION, dep.Apiversion)
		dep.Key = GetValue(results, KEY, dep.Key)
		dep.Cert = GetValue(results, CERT, dep.Cert)
	}

	return dep
}