You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/07/26 12:30:27 UTC

[incubator-openwhisk-workshop] branch master updated: Fix exercise 'binding triggers to actions' (#21)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-workshop.git


The following commit(s) were added to refs/heads/master by this push:
     new 2546698  Fix exercise 'binding triggers to actions' (#21)
2546698 is described below

commit 25466989e3c9e5703df2dac46cfe67f1c77b7e4c
Author: Juan Picca <ju...@users.noreply.github.com>
AuthorDate: Wed Jul 26 09:30:26 2017 -0300

    Fix exercise 'binding triggers to actions' (#21)
    
    Fix due changes in the api.
    
    Using client `2017-07-12T20:09:28+00:00`:
    
    ```
    $ wsk rule update first-trigger-rule rule-trigger first-trigger-action
    ok: updated rule first-trigger-rule
    $ wsk rule get first-trigger-rule
    ok: got rule first-trigger-rule
    {
        "namespace": "---",
        "name": "first-trigger-rule",
        "version": "0.0.1",
        "status": "active",
        "trigger": {
            "name": "rule-trigger",
            "path": "---"
        },
        "action": {
            "name": "first-trigger-action",
            "path": "---"
        },
        "publish": false
    }
    ```
---
 exercises/binding_triggers_to_actions/exercise.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exercises/binding_triggers_to_actions/exercise.js b/exercises/binding_triggers_to_actions/exercise.js
index f5d4cdb..bf092d1 100644
--- a/exercises/binding_triggers_to_actions/exercise.js
+++ b/exercises/binding_triggers_to_actions/exercise.js
@@ -62,7 +62,7 @@ exercise.addVerifyProcessor(function (cb) {
     if (exists) {
       this.emit('pass', 'OpenWhisk Rule first-trigger-rule exists')
       const rule = JSON.parse(stdout.match(/{[^]*$/)[0])
-      if (rule.trigger === 'rule-trigger') {
+      if (rule.trigger.name === 'rule-trigger') {
         this.emit('pass', 'OpenWhisk Rule first-trigger-rule bound to correct trigger')
       } else {
         this.emit('fail', 'OpenWhisk Rule first-trigger-rule bound to wrong trigger')
@@ -81,7 +81,7 @@ exercise.addVerifyProcessor(function (cb) {
     if (exists) {
       this.emit('pass', 'OpenWhisk Rule second-trigger-rule exists')
       const rule = JSON.parse(stdout.match(/{[^]*$/)[0])
-      if (rule.trigger === 'rule-trigger') {
+      if (rule.trigger.name === 'rule-trigger') {
         this.emit('pass', 'OpenWhisk Rule second-trigger-rule bound to correct trigger')
       } else {
         this.emit('fail', 'OpenWhisk Rule second-trigger-rule bound to wrong trigger')

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].