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/09/14 15:42:06 UTC

[incubator-openwhisk] branch master updated (20e0def -> 5856485)

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

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


    from 20e0def  Ensure that base64 encoded '+json' bodies are accepted and decoded. (#2646)
     new 0eda995  Correct unable to set apihost issue.
     new 5856485  Test change for api host setting which previously caused CLI to crash.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../scala/whisk/core/cli/test/WskConfigTests.scala  | 21 +++++++++++++++++++++
 tools/cli/go-whisk-cli/commands/util.go             |  4 ++++
 2 files changed, 25 insertions(+)

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

[incubator-openwhisk] 01/02: Correct unable to set apihost issue.

Posted by cs...@apache.org.
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.git

commit 0eda995039249de45dc64c43edba38dca43de06e
Author: David Liu <da...@cn.ibm.com>
AuthorDate: Mon Jul 10 14:57:43 2017 +0800

    Correct unable to set apihost issue.
---
 tools/cli/go-whisk-cli/commands/util.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/cli/go-whisk-cli/commands/util.go b/tools/cli/go-whisk-cli/commands/util.go
index fed9f59..9288cae 100644
--- a/tools/cli/go-whisk-cli/commands/util.go
+++ b/tools/cli/go-whisk-cli/commands/util.go
@@ -818,6 +818,10 @@ func getURLBase(host string, path string) (*url.URL, error)  {
         return nil, whiskErr
     }
 
+    if !strings.HasPrefix(host, "http") {
+        host = "https://" + host
+    }
+
     urlBase := fmt.Sprintf("%s%s", host, path)
     url, err := url.Parse(urlBase)
 

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

[incubator-openwhisk] 02/02: Test change for api host setting which previously caused CLI to crash.

Posted by cs...@apache.org.
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.git

commit 5856485aceaeb5b62570638be8ba28907f7b88b4
Author: Rodric Rabbah <ra...@us.ibm.com>
AuthorDate: Thu Sep 7 23:20:58 2017 -0400

    Test change for api host setting which previously caused CLI to crash.
---
 .../scala/whisk/core/cli/test/WskConfigTests.scala  | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
index 90b014d..8e34aea 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala
@@ -259,6 +259,27 @@ class WskConfigTests extends TestHelpers with WskTestHelpers {
     }
   }
 
+  it should "set api host with or without http prefix" in {
+    val tmpwskprops = File.createTempFile("wskprops", ".tmp")
+    try {
+      val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath())
+      Seq("", "http://", "https://").foreach { prefix =>
+        Seq("10", "10:123", "aaa", "aaa:123").foreach { host =>
+          val apihost = s"$prefix$host"
+          withClue(apihost) {
+            val rr = wsk.cli(Seq("property", "set", "--apihost", apihost), env = env)
+            rr.stdout.trim shouldBe s"ok: whisk API host set to $apihost"
+            rr.stderr shouldBe 'empty
+            val fileContent = FileUtils.readFileToString(tmpwskprops)
+            fileContent should include(s"APIHOST=$apihost")
+          }
+        }
+      }
+    } finally {
+      tmpwskprops.delete()
+    }
+  }
+
   it should "set auth in property file" in {
     val tmpwskprops = File.createTempFile("wskprops", ".tmp")
     val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath())

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