Skip to content

Commit 3031300

Browse files
committed
Review refactor
1 parent ca51a84 commit 3031300

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

commands/trigger.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package commands
2020
import (
2121
"errors"
2222
"fmt"
23+
"net/http"
2324

2425
"github.com/apache/incubator-openwhisk-cli/wski18n"
2526
"github.com/apache/incubator-openwhisk-client-go/whisk"
@@ -128,9 +129,9 @@ var triggerFireCmd = &cobra.Command{
128129
return werr
129130
}
130131

131-
if resp.StatusCode == 204 {
132+
if resp.StatusCode == http.StatusNoContent {
132133
fmt.Fprintf(color.Output,
133-
wski18n.T("trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule(s)\n",
134+
wski18n.T("trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule\n",
134135
map[string]interface{}{
135136
"namespace": boldString(qualifiedName.GetNamespace()),
136137
"name": boldString(qualifiedName.GetEntityName())}))

tests/src/test/scala/system/basic/WskCliBasicTests.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,8 @@ class WskCliBasicTests extends TestHelpers with WskTestHelpers {
757757
trigger.create(triggerName)
758758
}
759759

760-
val rr = wsk.trigger.fire(triggerName)
761-
val ns = wsk.namespace.whois()
762-
763-
rr.stdout should include regex(s"trigger /.*/$triggerName did not fire as it is not associated with an active rule\\(s\\)")
760+
wsk.trigger.fire(triggerName)
761+
.stdout should include regex(s"trigger /.*/$triggerName did not fire as it is not associated with an active rule")
764762
}
765763

766764
behavior of "Wsk Rule CLI"

wski18n/resources/en_US.all.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,8 @@
626626
"translation": "{{.ok}} triggered /{{.namespace}}/{{.name}} with id {{.id}}\n"
627627
},
628628
{
629-
"id": "trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule(s)\n",
630-
"translation": "trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule(s)\n"
629+
"id": "trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule\n",
630+
"translation": "trigger /{{.namespace}}/{{.name}} did not fire as it is not associated with an active rule\n"
631631
},
632632
{
633633
"id": "create new trigger",

0 commit comments

Comments
 (0)