MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / getSpaceGuid

Function getSpaceGuid

commands/util.go:1133–1153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1131}
1132
1133func getSpaceGuid() (string, error) {
1134 // get current props
1135 props, err := ReadProps(Properties.PropsFile)
1136 if err != nil {
1137 whisk.Debug(whisk.DbgError, "readProps(%s) failed: %s\n", Properties.PropsFile, err)
1138 errStr := wski18n.T("Unable to obtain the `auth` property value: {{.err}}", map[string]interface{}{"err": err})
1139 werr := whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE)
1140 return "", werr
1141 }
1142
1143 // get the auth key and parse out the space guid
1144 if authToken, hasProp := props["AUTH"]; hasProp {
1145 spaceGuid := strings.Split(authToken, ":")[0]
1146 return spaceGuid, nil
1147 }
1148
1149 whisk.Debug(whisk.DbgError, "auth not found in properties: %#q\n", props)
1150 errStr := wski18n.T("Auth key property value is not set")
1151 werr := whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE)
1152 return "", werr
1153}
1154
1155func isBlockingTimeout(err error) bool {
1156 var blockingTimeout bool

Callers

nothing calls this directly

Calls 1

ReadPropsFunction · 0.85

Tested by

no test coverage detected