This is an automated email from the ASF dual-hosted git repository.
mrutkowski pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git
The following commit(s) were added to refs/heads/master by this push:
new 535ae5b adding info message with openwhisk url for runtimes (#737)
535ae5b is described below
commit 535ae5ba30925aec111d85fb76617b83aaede86a
Author: Priti Desai <[email protected]>
AuthorDate: Fri Feb 16 07:51:55 2018 -0800
adding info message with openwhisk url for runtimes (#737)
---
utils/runtimes.go | 36 ++++++++++++++++++++----------------
wski18n/i18n_ids.go | 8 ++++----
wski18n/i18n_resources.go | 22 +++++++++++-----------
wski18n/resources/en_US.all.json | 8 ++++----
4 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/utils/runtimes.go b/utils/runtimes.go
index cacf980..48f6af6 100644
--- a/utils/runtimes.go
+++ b/utils/runtimes.go
@@ -22,19 +22,24 @@ import (
"encoding/json"
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
"io/ioutil"
"net/http"
"strings"
"time"
)
-const NODEJS_FILE_EXTENSION = "js"
-const SWIFT_FILE_EXTENSION = "swift"
-const PYTHON_FILE_EXTENSION = "py"
-const JAVA_FILE_EXTENSION = "java"
-const JAR_FILE_EXTENSION = "jar"
-const PHP_FILE_EXTENSION = "php"
-const ZIP_FILE_EXTENSION = "zip"
+const (
+ NODEJS_FILE_EXTENSION = "js"
+ SWIFT_FILE_EXTENSION = "swift"
+ PYTHON_FILE_EXTENSION = "py"
+ JAVA_FILE_EXTENSION = "java"
+ JAR_FILE_EXTENSION = "jar"
+ PHP_FILE_EXTENSION = "php"
+ ZIP_FILE_EXTENSION = "zip"
+ HTTP_CONTENT_TYPE_KEY = "Content-Type"
+ HTTP_CONTENT_TYPE_VALUE = "application/json; charset=UTF-8"
+)
// Structs used to denote the OpenWhisk Runtime information
type Limit struct {
@@ -74,10 +79,9 @@ var FileRuntimeExtensionsMap map[string]string
// `curl -k https://openwhisk.ng.bluemix.net`
// hard coding it here in case of network unavailable or failure.
func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
- // TODO() create HTTP header constants and use them
- ct := "application/json; charset=UTF-8"
- req, _ := http.NewRequest("GET", "https://"+apiHost, nil)
- req.Header.Set("Content-Type", ct)
+ url := "https://" + apiHost
+ req, _ := http.NewRequest("GET", url, nil)
+ req.Header.Set(HTTP_CONTENT_TYPE_KEY, HTTP_CONTENT_TYPE_VALUE)
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
}
@@ -104,16 +108,16 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo,
err error) {
}
// Local openwhisk deployment sometimes only returns "application/json"
as the content type
- // TODO() create HTTP header constants and use them
- if err != nil || !strings.Contains(ct, res.Header.Get("Content-Type")) {
+ if err != nil || !strings.Contains(HTTP_CONTENT_TYPE_VALUE,
res.Header.Get(HTTP_CONTENT_TYPE_KEY)) {
stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_LOCAL)
- whisk.Debug(whisk.DbgInfo, stdout)
+ wskprint.PrintOpenWhiskInfo(stdout)
err = json.Unmarshal(RUNTIME_DETAILS, &op)
} else {
b, _ := ioutil.ReadAll(res.Body)
if b != nil && len(b) > 0 {
- stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_NETWORK)
- whisk.Debug(whisk.DbgInfo, stdout)
+ stdout :=
wski18n.T(wski18n.ID_MSG_UNMARSHAL_NETWORK_X_url_X,
+ map[string]interface{}{"url": url})
+ wskprint.PrintOpenWhiskInfo(stdout)
err = json.Unmarshal(b, &op)
}
}
diff --git a/wski18n/i18n_ids.go b/wski18n/i18n_ids.go
index 3ce8f21..f0a223e 100644
--- a/wski18n/i18n_ids.go
+++ b/wski18n/i18n_ids.go
@@ -99,9 +99,9 @@ const (
ID_MSG_CONFIG_INFO_NAMESPACE_X_namespace_X_source_X =
"msg_config_namespace_info"
ID_MSG_CONFIG_INFO_APIGE_ACCESS_TOKEN_X_source_X =
"msg_config_apigw_access_token_info"
- // YAML marshall / unmarshall
- ID_MSG_UNMARSHAL_LOCAL = "msg_unmarshall_local"
- ID_MSG_UNMARSHAL_NETWORK = "msg_unmarshall_network"
+ // YAML marshal / unmarshal
+ ID_MSG_UNMARSHAL_LOCAL = "msg_unmarshal_local"
+ ID_MSG_UNMARSHAL_NETWORK_X_url_X = "msg_unmarshal_network"
// Informational
ID_MSG_DEPLOYMENT_CANCELLED = "msg_deployment_cancelled"
@@ -297,7 +297,7 @@ var I18N_ID_SET = [](string){
ID_MSG_UNDEPLOYMENT_FAILED,
ID_MSG_UNDEPLOYMENT_SUCCEEDED,
ID_MSG_UNMARSHAL_LOCAL,
- ID_MSG_UNMARSHAL_NETWORK,
+ ID_MSG_UNMARSHAL_NETWORK_X_url_X,
ID_WARN_COMMAND_RETRY,
ID_WARN_CONFIG_INVALID_X_path_X,
ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index fd6099d..303aff0 100644
--- a/wski18n/i18n_resources.go
+++ b/wski18n/i18n_resources.go
@@ -109,12 +109,12 @@ func wski18nResourcesDe_deAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
-var _wski18nResourcesEn_usAllJson =
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5a\x7b\x8f\x1b\xb7\x11\xff\xdf\x9f\x62\x60\x14\x70\x02\x9c\x65\x27\x45\x81\xc2\xc0\xa1\x70\x6b\x37\xb9\x26\xf6\x19\xf7\x48\x10\x38\x87\x35\xb5\x1c\xad\x18\x71\xc9\x05\xc9\x95\xac\x1c\xd4\xcf\x5e\x0c\xb9\x2f\xe9\x8e\xbb\x94\x9c\xa0\xf9\x27\xf2\x71\x38\xbf\x79\x90\xf3\xe2\x7e\x7c\x02\x70\xff\x04\x00\xe0\xa9\xe0\x4f\x5f\xc1\xd3\xd2\x16\x59\x65\x70\x21\x3e\x67\x68\x8c\x36\x4f\xcf\xc2\xaa\x33\x4c\x59\xc9
[...]
+var _wski18nResourcesEn_usAllJson =
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5a\x7b\x8f\x1b\xb7\x11\xff\xdf\x9f\x62\x60\x14\x70\x02\x9c\x65\x27\x45\x81\xc2\xc0\xa1\x70\x6b\x37\xb9\x26\xf6\x19\xf7\x48\x10\x38\x87\x35\xb5\x1c\xad\x18\x71\xc9\x05\xc9\x95\xac\x1c\xd4\xcf\x5e\x0c\xb9\x2f\xe9\x8e\xbb\x94\x9c\xa0\xf9\x27\xf2\x71\x38\xbf\x79\x90\xf3\xe2\x7e\x7c\x02\x70\xff\x04\x00\xe0\xa9\xe0\x4f\x5f\xc1\xd3\xd2\x16\x59\x65\x70\x21\x3e\x67\x68\x8c\x36\x4f\xcf\xc2\xaa\x33\x4c\x59\xc9
[...]
func wski18nResourcesEn_usAllJsonBytes() ([]byte, error) {
return bindataRead(
@@ -129,7 +129,7 @@ func wski18nResourcesEn_usAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size:
12809, mode: os.FileMode(420), modTime: time.Unix(1518160471, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size:
12827, mode: os.FileMode(420), modTime: time.Unix(1518559473, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -149,7 +149,7 @@ func wski18nResourcesEs_esAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -169,7 +169,7 @@ func wski18nResourcesFr_frAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size:
101, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size:
101, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -189,7 +189,7 @@ func wski18nResourcesIt_itAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -209,7 +209,7 @@ func wski18nResourcesJa_jaAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -229,7 +229,7 @@ func wski18nResourcesKo_krAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -249,7 +249,7 @@ func wski18nResourcesPt_brAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size:
0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -269,7 +269,7 @@ func wski18nResourcesZh_hansAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json",
size: 0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json",
size: 0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -289,7 +289,7 @@ func wski18nResourcesZh_hantAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json",
size: 0, mode: os.FileMode(420), modTime: time.Unix(1501631495, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json",
size: 0, mode: os.FileMode(420), modTime: time.Unix(1518211603, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
diff --git a/wski18n/resources/en_US.all.json b/wski18n/resources/en_US.all.json
index d6b81b4..883c706 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -144,12 +144,12 @@
"translation": "The apigw access token is set, from {{.source}}.\n"
},
{
- "id": "msg_unmarshall_local",
- "translation": "Unmarshal OpenWhisk info from local values.\n"
+ "id": "msg_unmarshal_local",
+ "translation": "Unmarshal OpenWhisk runtimes from local values.\n"
},
{
- "id": "msg_unmarshall_network",
- "translation": "Unmarshal OpenWhisk info from internet.\n"
+ "id": "msg_unmarshal_network",
+ "translation": "Unmarshal OpenWhisk runtimes from internet at {{.url}}.\n"
},
{
"id": "msg_deployment_cancelled",
--
To stop receiving notification emails like this one, please contact
[email protected].