dubeejw commented on a change in pull request #2474: Adding status of rule to 
output. 
URL: 
https://github.com/apache/incubator-openwhisk/pull/2474#discussion_r127281142
 
 

 ##########
 File path: tools/cli/go-whisk-cli/commands/rule.go
 ##########
 @@ -388,6 +388,18 @@ var ruleListCmd = &cobra.Command{
                     map[string]interface{}{"name": getClientNamespace(), 
"err": err})
             werr := whisk.MakeWskErrorFromWskError(errors.New(errStr), err, 
whisk.EXITCODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE)
             return werr
+        } else {
+            //No errors, lets attempt to retrieve the status of each rule #312
+            for index, rule := range rules {
+                ruleStatus, _, err := client.Rules.Get(rule.Name)
+                if err != nil {
+                    rules[index].Status = wski18n.T("Unknown")
+                    errStr := wski18n.T("Unable to get status of rule 
'{{.name}}': {{.err}}",
+                        map[string]interface{}{"name": rule.Name, "err": err})
+                    fmt.Println(errStr)
 
 Review comment:
   Should return the error after the print statement.
 
----------------------------------------------------------------
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