func()

in whisk/wskprops.go [194:213]


func (pi PropertiesImp) GetPropsFromWhiskProperties() *Wskprops {
	dep := GetDefaultWskprops(WHISK_PROPERTY)
	path := pi.OsPackage.Getenv(OPENWHISK_HOME, "") + "/" + OPENWHISK_PROPERTIES
	results, err := ReadProps(path)

	if err == nil {
		// TODO Determine why we have a hardcoed "test.auth" file here, is this only for unit tests? documented?
		authPath := GetValue(results, TEST_AUTH_FILE, "")
		b, err := ioutil.ReadFile(authPath)
		if err == nil {
			dep.AuthKey = strings.TrimSpace(string(b))
		}
		dep.APIHost = GetValue(results, OPENWHISK_HOST, "")
		dep.Namespace = DEFAULT_NAMESPACE
		if len(dep.AuthKey) > 0 {
			dep.APIGWSpaceSuid = strings.Split(dep.AuthKey, ":")[0]
		}
	}
	return dep
}