mdeuser commented on a change in pull request #2461: Get Action URL from CLI 
(Review)
URL: 
https://github.com/apache/incubator-openwhisk/pull/2461#discussion_r126001809
 
 

 ##########
 File path: tools/cli/go-whisk-cli/commands/action.go
 ##########
 @@ -846,38 +861,31 @@ func printActionDeleted(entityName string) {
 }
 
 // Check if the specified action is a web-action
-func isWebAction(client *whisk.Client, qname QualifiedName) error {
+func isWebAction(client *whisk.Client, qname QualifiedName) (error) {
     var err error = nil
 
     savedNs := client.Namespace
     client.Namespace = qname.namespace
     fullActionName := "/" + qname.namespace + "/" + qname.entityName
 
     action, _, err := client.Actions.Get(qname.entityName)
+
     if err != nil {
         whisk.Debug(whisk.DbgError, "client.Actions.Get(%s) error: %s\n", 
fullActionName, err)
         whisk.Debug(whisk.DbgError, "Unable to obtain action '%s' for web 
action validation\n", fullActionName)
-        err = errors.New(wski18n.T("API action '{{.name}}' does not exist", 
map[string]interface{}{"name": fullActionName}))
+        err = errors.New(wski18n.T("API action '{{.name}}' does not exist", 
map[string]interface{}{"name": fullActionName})) // wrong need 404
     } else {
+        // wrong error messages
         err = errors.New(wski18n.T("API action '{{.name}}' is not a web 
action. Issue 'wsk action update {{.name}} --web true' to convert the action to 
a web action.",
             map[string]interface{}{"name": fullActionName}))
-        weVal := getValue(action.Annotations, "web-export")
-        if (weVal == nil) {
-            whisk.Debug(whisk.DbgError, "getValue(annotations, web-export) for 
action %s found no value\n", fullActionName)
-        } else {
-            var webExport bool
-            var ok bool
-            if webExport, ok = weVal.(bool); !ok {
-                whisk.Debug(whisk.DbgError, "web-export annotation value (%v) 
is not a boolean\n", weVal)
 
 Review comment:
   Replacement `WebAction` method does not have the same debug output..
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to