You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/25 03:14:11 UTC
[GitHub] houshengbo closed pull request #688: Move all hardcoded strings from Cobra commands and remaining .go files into i18n files.
houshengbo closed pull request #688: Move all hardcoded strings from Cobra commands and remaining .go files into i18n files.
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/688
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.gitignore b/.gitignore
index dcf046a7..73345b7b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,8 +32,9 @@ openwhisk-wskdeploy
incubator-openwhisk-wskdeploy
wskdeploy
-#GoGlanD IDE
+# Go IDE
.idea
+*.iml
# Gradle
.gradle
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 06088036..4576bf6b 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -9,8 +9,8 @@
},
{
"ImportPath": "github.com/fatih/color",
- "Comment": "v1.1.0-4-gbf82308",
- "Rev": "bf82308e8c8546dc2b945157173eb8a959ae9505"
+ "Comment": "v1.5.0",
+ "Rev": "570b54cabe6b8eb0bc2dfce68d964677d63b5260"
},
{
"ImportPath": "github.com/fsnotify/fsnotify",
diff --git a/cmd/add.go b/cmd/add.go
index d18a86d3..24eab52c 100644
--- a/cmd/add.go
+++ b/cmd/add.go
@@ -19,25 +19,26 @@ package cmd
import (
"bufio"
- "fmt"
"os"
-
+ "github.com/spf13/cobra"
"github.com/apache/incubator-openwhisk-wskdeploy/parsers"
"github.com/apache/incubator-openwhisk-wskdeploy/utils"
- "github.com/spf13/cobra"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
)
// addCmd represents the add command
var addCmd = &cobra.Command{
- Use: "add",
- SuggestFor: []string {"increase"},
- Short: "Add an action, feed, trigger or rule to the manifest",
+ Use: "add",
+ SuggestFor: []string {"insert"},
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_ADD),
}
// action represents the `add action` command
var actionCmd = &cobra.Command{
Use: "action",
- Short: "add action to the manifest file and create default directory structure.",
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_ADD_X_key_X,
+ map[string]interface{}{wski18n.KEY_KEY: parsers.YAML_KEY_ACTION}),
RunE: func(cmd *cobra.Command, args []string) error {
maniyaml, err := parsers.ReadOrCreateManifest()
if err != nil {
@@ -48,16 +49,23 @@ var actionCmd = &cobra.Command{
action := parsers.Action{}
for {
- action.Name = utils.Ask(reader, "Name", "")
+ action.Name = utils.Ask(reader, wski18n.NAME_ACTION, "")
// Check action name is unique
if _, ok := maniyaml.Package.Actions[action.Name]; !ok {
break
}
- fmt.Print(action.Name + " is already used. Pick another action name\n")
+
+ warnMsg := wski18n.T(wski18n.ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_ACTION,
+ wski18n.KEY_NAME: action.Name})
+ wskprint.PrintOpenWhiskWarning(warnMsg)
}
- action.Runtime = utils.Ask(reader, "Runtime", "nodejs:6")
+ // TODO() use dynamic/programmatic way to get default runtime (not hardcoded)
+ // TODO() And List all supported runtime names (values) (via API)
+ action.Runtime = utils.Ask(reader, wski18n.NAME_RUNTIME, "nodejs:6")
maniyaml.Package.Actions[action.Name] = action
// Create directory structure before update manifest, as a way
@@ -75,7 +83,8 @@ var actionCmd = &cobra.Command{
// trigger represents the `add trigger` command
var triggerCmd = &cobra.Command{
Use: "trigger",
- Short: "add trigger to the manifest file.",
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_ADD_X_key_X,
+ map[string]interface{}{wski18n.KEY_KEY: parsers.YAML_KEY_TRIGGER}),
RunE: func(cmd *cobra.Command, args []string) error {
maniyaml, err := parsers.ReadOrCreateManifest()
if err != nil {
@@ -86,16 +95,21 @@ var triggerCmd = &cobra.Command{
trigger := parsers.Trigger{}
for {
- trigger.Name = utils.Ask(reader, "Name", "")
+ trigger.Name = utils.Ask(reader, wski18n.NAME_TRIGGER, "")
// Check trigger name is unique
if _, ok := maniyaml.Package.Triggers[trigger.Name]; !ok {
break
}
- fmt.Print(trigger.Name + " is already used. Pick another trigger name\n")
+
+ warnMsg := wski18n.T(wski18n.ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_TRIGGER,
+ wski18n.KEY_NAME: trigger.Name})
+ wskprint.PrintOpenWhiskWarning(warnMsg)
}
- trigger.Feed = utils.Ask(reader, "Feed", "")
+ trigger.Feed = utils.Ask(reader, wski18n.NAME_FEED, "")
maniyaml.Package.Triggers[trigger.Name] = trigger
return parsers.Write(maniyaml, utils.ManifestFileNameYaml)
@@ -105,7 +119,8 @@ var triggerCmd = &cobra.Command{
// rule represents the `add rule` command
var ruleCmd = &cobra.Command{
Use: "rule",
- Short: "add rule to the manifest file.",
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_ADD_X_key_X,
+ map[string]interface{}{wski18n.KEY_KEY: parsers.YAML_KEY_RULE}),
RunE: func(cmd *cobra.Command, args []string) error {
maniyaml, err := parsers.ReadOrCreateManifest()
if err != nil {
@@ -116,17 +131,22 @@ var ruleCmd = &cobra.Command{
rule := parsers.Rule{}
for {
- rule.Rule = utils.Ask(reader, "Rule Name", "")
+ rule.Rule = utils.Ask(reader, wski18n.NAME_RULE, "")
// Check rule name is unique
if _, ok := maniyaml.Package.Triggers[rule.Rule]; !ok {
break
}
- fmt.Print(rule.Rule + " is already used. Pick another rule name\n")
+
+ warnMsg := wski18n.T(wski18n.ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_RULE,
+ wski18n.KEY_NAME: rule.Name})
+ wskprint.PrintOpenWhiskWarning(warnMsg)
}
- rule.Action = utils.Ask(reader, "Action", "")
- rule.Trigger = utils.Ask(reader, "Trigger", "")
+ rule.Action = utils.Ask(reader, wski18n.NAME_ACTION, "")
+ rule.Trigger = utils.Ask(reader, wski18n.NAME_TRIGGER, "")
maniyaml.Package.Rules[rule.Rule] = rule
return parsers.Write(maniyaml, utils.ManifestFileNameYaml)
diff --git a/cmd/publish.go b/cmd/publish.go
index ff0a4aae..22020ba1 100644
--- a/cmd/publish.go
+++ b/cmd/publish.go
@@ -18,60 +18,72 @@
package cmd
import (
- "fmt"
-
"bufio"
- "github.com/apache/incubator-openwhisk-wskdeploy/parsers"
- "github.com/apache/incubator-openwhisk-wskdeploy/utils"
- "github.com/spf13/cobra"
"net/http"
"net/url"
"os"
"path"
"strings"
+ "github.com/spf13/cobra"
+ "github.com/apache/incubator-openwhisk-wskdeploy/parsers"
+ "github.com/apache/incubator-openwhisk-wskdeploy/utils"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
)
// publishCmd represents the publish command
var publishCmd = &cobra.Command{
- Use: "publish",
- SuggestFor: []string {"publicize"},
- Short: "Publish a package to a registry",
- Long: `Publish a package to the registry set in ~/.wskprops`,
+ Use: "publish",
+ SuggestFor: []string{"publicize"},
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_PUBLISH),
+ Long: wski18n.T(wski18n.ID_CMD_DESC_LONG_PUBLISH),
RunE: func(cmd *cobra.Command, args []string) error {
// Get registry location
-
userHome := utils.GetHomeDirectory()
propPath := path.Join(userHome, ".wskprops")
configs, err := utils.ReadProps(propPath)
if err != nil {
- return err
- }
+ return err
+ }
registry, ok := configs["REGISTRY"]
if !ok {
+ wskprint.PrintOpenWhiskError(
+ wski18n.T(wski18n.ID_ERR_URL_INVALID_X_urltype_X_url_X_filetype_X,
+ map[string]interface{}{
+ wski18n.KEY_URL_TYPE: wski18n.REGISTRY,
+ wski18n.KEY_URL: "",
+ wski18n.KEY_FILE_TYPE: wski18n.WHISK_PROPS}))
+
+ // TODO() should only read if interactive mode is on
reader := bufio.NewReader(os.Stdin)
- fmt.Print("Registry URL not found in ~./wskprops. Must be set before publishing.\n")
for {
- registry = utils.Ask(reader, "Registry URL", "")
+ registry = utils.Ask(reader, wski18n.REGISTRY_URL, "")
_, err := url.Parse(registry)
if err == nil {
- // TODO: send request to registry to check it exists.
+ // TODO() send request to registry to check if it exists.
break
}
- fmt.Print("Malformed repository URL. Try again")
+ // Tell user the URL they entered was invalid, try again...
+ wskprint.PrintOpenWhiskError(
+ wski18n.T(wski18n.ID_ERR_URL_MALFORMED_X_urltype_X_url_X,
+ map[string]interface{}{
+ wski18n.KEY_URL_TYPE: wski18n.REGISTRY,
+ wski18n.KEY_URL: registry}))
}
+
configs["REGISTRY"] = registry
utils.WriteProps(propPath, configs)
}
// Get repo URL
maniyaml, err := parsers.ReadOrCreateManifest()
- if err != nil {
- return err
- }
+ if err != nil {
+ return err
+ }
if len(maniyaml.Package.Repositories) > 0 {
repoURL := maniyaml.Package.Repositories[0].Url
@@ -79,28 +91,38 @@ var publishCmd = &cobra.Command{
paths := strings.Split(repoURL, "/")
l := len(paths)
if l < 2 {
- fmt.Print("Fatal error: malformed repository URL in manifest file :" + repoURL)
+ wskprint.PrintOpenWhiskError(
+ wski18n.T(wski18n.ID_ERR_URL_INVALID_X_urltype_X_url_X_filetype_X,
+ map[string]interface{}{
+ wski18n.KEY_URL_TYPE: wski18n.REPOSITORY,
+ wski18n.KEY_URL: repoURL,
+ wski18n.KEY_FILE_TYPE: wski18n.MANIFEST}))
return nil
}
- repo := paths[l-1]
- owner := paths[l-2]
+ repo := paths[l - 1]
+ owner := paths[l - 2]
// Send HTTP request
client := &http.Client{}
- request, err := http.NewRequest("PUT", registry+"?owner="+owner+"&repo="+repo, nil)
+ request, err := http.NewRequest("PUT", registry + "?owner=" + owner + "&repo=" + repo, nil)
if err != nil {
- return err
- }
+ return err
+ }
_, err = client.Do(request)
- if err != nil {
- return err
- }
+ if err != nil {
+ return err
+ }
} else {
- fmt.Print("Fatal error: missing repository URL in manifest file.")
+ wskprint.PrintOpenWhiskError(
+ wski18n.T(wski18n.ID_ERR_URL_INVALID_X_urltype_X_url_X_filetype_X,
+ map[string]interface{}{
+ wski18n.KEY_URL_TYPE: wski18n.REPOSITORY,
+ wski18n.KEY_URL: "",
+ wski18n.KEY_FILE_TYPE: wski18n.MANIFEST}))
}
- return nil
+ return nil
},
}
diff --git a/cmd/report.go b/cmd/report.go
index 0bc5645d..37a361dc 100644
--- a/cmd/report.go
+++ b/cmd/report.go
@@ -19,16 +19,15 @@ package cmd
import (
"fmt"
+ "path"
+ "sync"
+ "os"
+ "github.com/spf13/cobra"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/deployers"
"github.com/apache/incubator-openwhisk-wskdeploy/utils"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
- "github.com/fatih/color"
- "github.com/spf13/cobra"
- "path"
- "sync"
- "os"
- "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
)
var wskpropsPath string
@@ -38,31 +37,34 @@ var wg sync.WaitGroup
// reportCmd represents the report command
var reportCmd = &cobra.Command{
- Use: "report",
- SuggestFor: []string {"list"},
- Short: "Returns summary of what's been deployed on OpenWhisk in specific namespace",
- Long: `Command helps user get an overall report about what's been deployed
-on OpenWhisk with specific OpenWhisk namespace. By default it will read the wsk property file
-located under current user home.`,
+ Use: "report",
+ SuggestFor: []string{"list"},
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_REPORT),
RunE: func(cmd *cobra.Command, args []string) error {
if wskpropsPath != "" {
config, _ := deployers.NewWhiskConfig(wskpropsPath, utils.Flags.DeploymentPath, utils.Flags.ManifestPath, false)
- client, _ := deployers.CreateNewClient(config)
- return printDeploymentInfo(client)
+ client, _ := deployers.CreateNewClient(config)
+ return printDeploymentInfo(client)
} else {
- //default to ~/.wskprops
- userHome := utils.GetHomeDirectory()
- propPath := path.Join(userHome, ".wskprops")
- config, _ := deployers.NewWhiskConfig(propPath, utils.Flags.DeploymentPath, utils.Flags.ManifestPath, false)
- client, _ := deployers.CreateNewClient(config)
- return printDeploymentInfo(client)
- }
+ //default to ~/.wskprops
+ userHome := utils.GetHomeDirectory()
+ // TODO() we should not only use const. for config files like .wskprops, but have a dedicated
+ // set of functions in its own package to interact with it as a resource
+ propPath := path.Join(userHome, ".wskprops")
+ config, _ := deployers.NewWhiskConfig(propPath, utils.Flags.DeploymentPath, utils.Flags.ManifestPath, false)
+ client, _ := deployers.CreateNewClient(config)
+ return printDeploymentInfo(client)
+ }
},
}
func init() {
RootCmd.AddCommand(reportCmd)
- reportCmd.Flags().StringVarP(&wskpropsPath, "wskproppath", "w", path.Join(os.Getenv("HOME"), ".wskprops"), "path to wsk property file, default is to ~/.wskprops")
+
+ // TODO() REMOVE this flag... the flag -config exists already
+ reportCmd.Flags().StringVarP(&wskpropsPath, "wskproppath", "w",
+ path.Join(os.Getenv("HOME"), ".wskprops"),
+ wski18n.T(wski18n.ID_CMD_FLAG_CONFIG))
// Here you will define your flags and configuration settings.
@@ -73,23 +75,19 @@ func init() {
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// reportCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
-
}
-var boldString = color.New(color.Bold).SprintFunc()
-
func printDeploymentInfo(client *whisk.Client) error {
//We currently list packages, actions, triggers, rules.
wg.Add(4)
- // TODO() i18n
- wskprint.PrintlnOpenWhiskStatus("----==== OpenWhisk Deployment Status ====----")
+ wskprint.PrintlnOpenWhiskInfo(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_REPORT))
// we set the default package list options
pkgoptions := &whisk.PackageListOptions{false, 0, 0, 0, false}
packages, _, err := client.Packages.List(pkgoptions)
- if err != nil {
- return err
- }
+ if err != nil {
+ return err
+ }
// list all packages under current namespace.
go func() {
@@ -103,24 +101,24 @@ func printDeploymentInfo(client *whisk.Client) error {
acnoptions := &whisk.ActionListOptions{0, 0, false}
for _, pkg := range packages {
actions, _, err := client.Actions.List(pkg.Name, acnoptions)
- if err != nil {
- return err
- }
+ if err != nil {
+ return err
+ }
printActionList(actions)
}
- return nil
+ return nil
}()
// list all the triggers under current namespace.
go func() error {
defer wg.Done()
troptions := &whisk.TriggerListOptions{0, 0, false}
- _, _, err := client.Triggers.List(troptions)
- if err != nil {
- return err
- }
+ _, _, err := client.Triggers.List(troptions)
+ if err != nil {
+ return err
+ }
//printTriggerList(triggers)
- return nil
+ return nil
}()
// list all the rules under current namespace.
@@ -128,11 +126,11 @@ func printDeploymentInfo(client *whisk.Client) error {
defer wg.Done()
roptions := &whisk.RuleListOptions{0, 0, false}
rules, _, err := client.Rules.List(roptions)
- if err != nil {
- return err
- }
+ if err != nil {
+ return err
+ }
printRuleList(rules)
- return nil
+ return nil
}()
wg.Wait()
@@ -146,6 +144,7 @@ func printList(collection interface{}) {
switch collection := collection.(type) {
case []whisk.Action:
printActionList(collection)
+ // TODO()
//case []whisk.Trigger
// printTriggerList(collection)
case []whisk.Package:
@@ -159,43 +158,58 @@ func printList(collection interface{}) {
}
}
+// TODO() i18n private / shared never translated
func printRuleList(rules []whisk.Rule) {
- fmt.Fprintf(color.Output, "%s\n", boldString("rules"))
+ wskprint.PrintlnOpenWhiskInfoTitle(wski18n.RULES)
+
for _, rule := range rules {
publishState := wski18n.T("private")
if *rule.Publish {
publishState = wski18n.T("shared")
}
- fmt.Printf("%-70s %s\n", fmt.Sprintf("/%s/%s", rule.Namespace, rule.Name), publishState)
+ output := fmt.Sprintf("%-70s %s\n",
+ fmt.Sprintf("/%s/%s", rule.Namespace, rule.Name),
+ publishState)
+ wskprint.PrintlnOpenWhiskInfo(output)
}
}
+// TODO() i18n private / shared never translated
func printPackageList(packages []whisk.Package) {
- fmt.Fprintf(color.Output, "%s\n", boldString("packages"))
+ wskprint.PrintlnOpenWhiskInfoTitle(wski18n.PACKAGES)
for _, xPackage := range packages {
publishState := wski18n.T("private")
if *xPackage.Publish {
publishState = wski18n.T("shared")
}
- fmt.Printf("%-70s %s\n", fmt.Sprintf("/%s/%s", xPackage.Namespace, xPackage.Name), publishState)
+ output := fmt.Sprintf("%-70s %s\n",
+ fmt.Sprintf("/%s/%s", xPackage.Namespace, xPackage.Name),
+ publishState)
+ wskprint.PrintlnOpenWhiskInfo(output)
}
}
+// TODO() i18n private / shared never translated
func printActionList(actions []whisk.Action) {
- fmt.Fprintf(color.Output, "%s\n", boldString("actions"))
+ wskprint.PrintlnOpenWhiskInfoTitle(wski18n.ACTIONS)
for _, action := range actions {
publishState := wski18n.T("private")
if *action.Publish {
publishState = wski18n.T("shared")
}
kind := getValueString(action.Annotations, "exec")
- fmt.Printf("%-70s %s %s\n", fmt.Sprintf("/%s/%s", action.Namespace, action.Name), publishState, kind)
+ output := fmt.Sprintf("%-70s %s %s\n",
+ fmt.Sprintf("/%s/%s", action.Namespace, action.Name),
+ publishState,
+ kind)
+ wskprint.PrintlnOpenWhiskInfo(output)
}
}
/*
func printTriggerList(triggers whisk.Trigger) {
- fmt.Fprintf(color.Output, "%s\n", boldString("triggers"))
+ //fmt.Fprintf(color.Output, "%s\n", boldString("triggers"))
+ wskprint.PrintlnOpenWhiskInfoTitle(wski18n.TRIGGERS)
for _, trigger := range triggers {
publishState := wski18n.T("private")
if trigger.Publish {
@@ -216,7 +230,9 @@ func getValueString(keyValueArr whisk.KeyValueArr, key string) string {
res = castedValue
}
- whisk.Debug(whisk.DbgInfo, "Got string value '%v' for key '%s'\n", res, key)
+ // TODO() This may be too much for end-user debug/trace
+ //dbgMsg := fmt.Sprintf("keyValueArr[%v]: key=[%s] value=[%v]\n", keyValueArr, key, res)
+ //wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg )
return res
}
@@ -231,21 +247,25 @@ func getValue(keyValueArr whisk.KeyValueArr, key string) interface{} {
}
}
- whisk.Debug(whisk.DbgInfo, "Got value '%v' from '%v' for key '%s'\n", res, keyValueArr, key)
+ // TODO() This may be too much for end-user debug/trace
+ //dbgMsg := fmt.Sprintf("keyValueArr[%v]: key=[%s] value=[%v]\n", keyValueArr, key, res)
+ //wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg )
return res
}
func printNamespaceList(namespaces []whisk.Namespace) {
- fmt.Fprintf(color.Output, "%s\n", boldString("namespaces"))
+ wskprint.PrintlnOpenWhiskInfo(wski18n.NAMESPACES)
for _, namespace := range namespaces {
- fmt.Printf("%s\n", namespace.Name)
+ output := fmt.Sprintf("%s\n", namespace.Name)
+ wskprint.PrintlnOpenWhiskInfo(output)
}
}
func printActivationList(activations []whisk.Activation) {
- fmt.Fprintf(color.Output, "%s\n", boldString("activations"))
+ wskprint.PrintlnOpenWhiskInfo(wski18n.ACTIVATIONS)
for _, activation := range activations {
- fmt.Printf("%s %20s\n", activation.ActivationID, activation.Name)
+ output := fmt.Sprintf("%s %20s\n", activation.ActivationID, activation.Name)
+ wskprint.PrintlnOpenWhiskInfo(output)
}
}
diff --git a/cmd/root.go b/cmd/root.go
index 25ccc300..16008022 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -21,18 +21,18 @@ import (
"encoding/json"
"errors"
"fmt"
- "github.com/apache/incubator-openwhisk-client-go/whisk"
- "github.com/apache/incubator-openwhisk-wskdeploy/deployers"
- "github.com/apache/incubator-openwhisk-wskdeploy/utils"
- "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
- "github.com/spf13/cobra"
"os"
"path"
"path/filepath"
"regexp"
"strings"
+ "github.com/spf13/cobra"
"github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
"github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
+ "github.com/apache/incubator-openwhisk-client-go/whisk"
+ "github.com/apache/incubator-openwhisk-wskdeploy/deployers"
+ "github.com/apache/incubator-openwhisk-wskdeploy/utils"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
)
var stderr = ""
@@ -40,15 +40,11 @@ var stdout = ""
// TODO(#683) short and long desc. should be translated for i18n
var RootCmd = &cobra.Command{
- Use: "wskdeploy",
- SilenceErrors: true,
- SilenceUsage: true,
- Short: "A tool set to help deploy your openwhisk packages in batch.",
- Long: `A tool to deploy openwhisk packages with a manifest and/or deployment yaml file.
-
-wskdeploy without any commands or flags deploys openwhisk package in the current directory if manifest.yaml exists.
-
- `,
+ Use: "wskdeploy",
+ SilenceErrors: true,
+ SilenceUsage: true,
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_ROOT),
+ Long: wski18n.T(wski18n.ID_CMD_DESC_LONG_ROOT),
// Uncomment the following line if your bare application
// has an action associated with it:
RunE: RootCmdImp,
@@ -74,8 +70,9 @@ func Execute() {
os.Exit(-1)
} else {
if utils.Flags.WithinOpenWhisk {
- // TODO() i18n
- fmt.Print(`{"deploy":"success"}`) // maybe return report of what has been deployed.
+ // TODO() Why are we printing success here?
+ // TODO() maybe return report of what has been deployed.
+ wskprint.PrintlnOpenWhiskSuccess(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_SUCCEEDED))
}
}
}
@@ -84,11 +81,11 @@ func Execute() {
// (i.e., command and arguments) is JSON data (map).
func substCmdArgs() error {
// Extract arguments from input JSON string
-
// { "cmd": ".." } // space-separated arguments
arg := os.Args[1]
+ // TODO() Move to proper status output/debug/trace
fmt.Println("arg is " + arg)
// unmarshal the string to a JSON object
var obj map[string]interface{}
@@ -98,12 +95,13 @@ func substCmdArgs() error {
regex, _ := regexp.Compile("[ ]+")
os.Args = regex.Split("wskdeploy "+strings.TrimSpace(v), -1)
} else {
- return errors.New(wski18n.T(wski18n.ID_JSON_MISSING_KEY_CMD))
+ return errors.New(wski18n.T(wski18n.ID_ERR_JSON_MISSING_KEY_CMD))
}
return nil
}
func init() {
+ // TODO() move Env var. to some global const
utils.Flags.WithinOpenWhisk = len(os.Getenv("__OW_API_HOST")) > 0
cobra.OnInitialize(initConfig)
@@ -113,24 +111,27 @@ func init() {
// will be global for your application.
// TODO(#682) add in-line descriptions to i18n resource file
- RootCmd.PersistentFlags().StringVar(&utils.Flags.CfgFile, "config", "", "config file (default is $HOME/.wskprops)")
+ RootCmd.PersistentFlags().StringVar(&utils.Flags.CfgFile, "config", "", wski18n.T(wski18n.ID_CMD_FLAG_CONFIG))
// Cobra also supports local flags, which will only run
// when this action is called directly.
- RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
- RootCmd.Flags().StringVarP(&utils.Flags.ProjectPath, "project", "p", ".", "path to serverless project")
- RootCmd.Flags().StringVarP(&utils.Flags.ManifestPath, "manifest", "m", "", "path to manifest file")
- RootCmd.Flags().StringVarP(&utils.Flags.DeploymentPath, "deployment", "d", "", "path to deployment file")
- RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Strict, "strict", "s", false, "allow user defined runtime version")
- RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseInteractive, "allow-interactive", "i", false, "allow interactive prompts")
- RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseDefaults, "allow-defaults", "a", false, "allow defaults")
- RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Verbose, "verbose", "v", false, "verbose output")
+ // TODO() Publish command, not completed
+ // TODO() Report command, not completed
+ // TODO() What does toggle do? adding this flag seems to produce an error
+ RootCmd.Flags().BoolP("toggle", "t", false, wski18n.T(wski18n.ID_CMD_FLAG_TOGGLE_HELP))
+ RootCmd.Flags().StringVarP(&utils.Flags.ProjectPath, "project", "p", ".", wski18n.T(wski18n.ID_CMD_FLAG_PROJECT))
+ RootCmd.Flags().StringVarP(&utils.Flags.ManifestPath, "manifest", "m", "", wski18n.T(wski18n.ID_CMD_FLAG_MANIFEST))
+ RootCmd.Flags().StringVarP(&utils.Flags.DeploymentPath, "deployment", "d", "", wski18n.T(wski18n.ID_CMD_FLAG_DEPLOYMENT))
+ RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Strict, "strict", "s", false, wski18n.T(wski18n.ID_CMD_FLAG_STRICT))
+ RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseInteractive, "allow-interactive", "i", false, wski18n.T(wski18n.ID_CMD_FLAG_INTERACTIVE))
+ RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseDefaults, "allow-defaults", "a", false, wski18n.T(wski18n.ID_CMD_FLAG_DEFAULTS))
+ RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Verbose, "verbose", "v", false, wski18n.T(wski18n.ID_CMD_FLAG_VERBOSE))
RootCmd.PersistentFlags().StringVarP(&utils.Flags.ApiHost, "apihost", "", "", wski18n.T(wski18n.ID_CMD_FLAG_API_HOST))
RootCmd.PersistentFlags().StringVarP(&utils.Flags.Namespace, "namespace", "n", "", wski18n.T(wski18n.ID_CMD_FLAG_NAMESPACE))
RootCmd.PersistentFlags().StringVarP(&utils.Flags.Auth, "auth", "u", "", wski18n.T(wski18n.ID_CMD_FLAG_AUTH_KEY))
RootCmd.PersistentFlags().StringVar(&utils.Flags.ApiVersion, "apiversion", "", wski18n.T(wski18n.ID_CMD_FLAG_API_VERSION))
RootCmd.PersistentFlags().StringVarP(&utils.Flags.Key, "key", "k", "", wski18n.T(wski18n.ID_CMD_FLAG_KEY_FILE))
RootCmd.PersistentFlags().StringVarP(&utils.Flags.Cert, "cert", "c", "", wski18n.T(wski18n.ID_CMD_FLAG_CERT_FILE))
- RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Managed, "managed", "", false, "mark project entities as managed")
+ RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Managed, "managed", "", false, wski18n.T(wski18n.ID_CMD_FLAG_MANAGED))
}
// initConfig reads in config file and ENV variables if set.
@@ -143,8 +144,10 @@ func initConfig() {
_, err := whisk.ReadProps(utils.Flags.CfgFile)
if err != nil {
utils.Flags.CfgFile = defaultPath
- // TODO() i18n
- wskprint.PrintOpenWhiskWarning("Invalid config file detected, so by default it is set to " + utils.Flags.CfgFile + "\n")
+ warn := wski18n.T(wski18n.ID_WARN_CONFIG_INVALID_X_path_X,
+ map[string]interface{}{
+ wski18n.KEY_PATH: utils.Flags.CfgFile})
+ wskprint.PrintOpenWhiskWarning(warn)
}
} else {
@@ -174,18 +177,19 @@ func Deploy() error {
}
projectPath, _ := filepath.Abs(project_Path)
+ // TODO() identical code block below; please create function both can share
if utils.Flags.ManifestPath == "" {
if _, err := os.Stat(path.Join(projectPath, utils.ManifestFileNameYaml)); err == nil {
utils.Flags.ManifestPath = path.Join(projectPath, utils.ManifestFileNameYaml)
stdout = wski18n.T(wski18n.ID_MSG_MANIFEST_DEPLOY_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
} else if _, err := os.Stat(path.Join(projectPath, utils.ManifestFileNameYml)); err == nil {
utils.Flags.ManifestPath = path.Join(projectPath, utils.ManifestFileNameYml)
stdout = wski18n.T(wski18n.ID_MSG_MANIFEST_DEPLOY_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
} else {
- stderr = wski18n.T(wski18n.ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X,
- map[string]interface{}{"path": projectPath})
+ stderr = wski18n.T(wski18n.ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X,
+ map[string]interface{}{wski18n.KEY_PATH: projectPath})
return wskderrors.NewErrorManifestFileNotFound(projectPath, stderr)
}
whisk.Debug(whisk.DbgInfo, stdout)
@@ -243,8 +247,8 @@ func Deploy() error {
}
} else {
- errString := wski18n.T(wski18n.ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ errString := wski18n.T(wski18n.ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X,
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
whisk.Debug(whisk.DbgError, errString)
return wskderrors.NewErrorManifestFileNotFound(utils.Flags.ManifestPath, errString)
}
@@ -268,26 +272,37 @@ func Undeploy() error {
if _, err := os.Stat(path.Join(projectPath, utils.ManifestFileNameYaml)); err == nil {
utils.Flags.ManifestPath = path.Join(projectPath, utils.ManifestFileNameYaml)
stdout = wski18n.T(wski18n.ID_MSG_MANIFEST_UNDEPLOY_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
} else if _, err := os.Stat(path.Join(projectPath, utils.ManifestFileNameYml)); err == nil {
utils.Flags.ManifestPath = path.Join(projectPath, utils.ManifestFileNameYml)
stdout = wski18n.T(wski18n.ID_MSG_MANIFEST_UNDEPLOY_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
} else {
- stderr = wski18n.T(wski18n.ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X,
- map[string]interface{}{"path": projectPath})
+ stderr = wski18n.T(wski18n.ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X,
+ map[string]interface{}{wski18n.KEY_PATH: projectPath})
return wskderrors.NewErrorManifestFileNotFound(projectPath, stderr)
}
- whisk.Debug(whisk.DbgInfo, stdout)
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, stdout)
}
if utils.Flags.DeploymentPath == "" {
if _, err := os.Stat(path.Join(projectPath, utils.DeploymentFileNameYaml)); err == nil {
utils.Flags.DeploymentPath = path.Join(projectPath, utils.DeploymentFileNameYaml)
- fmt.Printf("Using %s for undeployment \n", utils.Flags.DeploymentPath)
+ // TODO() have a single function that conditionally (verbose) prints ALL Flags
+ dbgMsg := fmt.Sprintf("%s >> [%s]: [%s]",
+ wski18n.T(wski18n.ID_DEBUG_UNDEPLOYING_USING),
+ wski18n.DEPLOYMENT,
+ utils.Flags.DeploymentPath)
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg)
+
} else if _, err := os.Stat(path.Join(projectPath, utils.DeploymentFileNameYml)); err == nil {
utils.Flags.DeploymentPath = path.Join(projectPath, utils.DeploymentFileNameYml)
- fmt.Printf("Using %s for undeployment \n", utils.Flags.DeploymentPath)
+ // TODO() have a single function that conditionally (verbose) prints ALL Flags
+ dbgMsg := fmt.Sprintf("%s >> [%s]: [%s]",
+ wski18n.T(wski18n.ID_DEBUG_UNDEPLOYING_USING),
+ wski18n.DEPLOYMENT,
+ utils.Flags.DeploymentPath)
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg)
}
}
@@ -330,8 +345,8 @@ func Undeploy() error {
}
} else {
- errString := wski18n.T(wski18n.ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X,
- map[string]interface{}{"path": utils.Flags.ManifestPath})
+ errString := wski18n.T(wski18n.ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X,
+ map[string]interface{}{wski18n.KEY_PATH: utils.Flags.ManifestPath})
return wskderrors.NewErrorManifestFileNotFound(utils.Flags.ManifestPath, errString)
}
}
diff --git a/cmd/version.go b/cmd/version.go
index 0f732d74..ef63f79f 100644
--- a/cmd/version.go
+++ b/cmd/version.go
@@ -19,8 +19,10 @@ package cmd
import (
"fmt"
- "github.com/apache/incubator-openwhisk-wskdeploy/utils"
"github.com/spf13/cobra"
+ "github.com/apache/incubator-openwhisk-wskdeploy/utils"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
)
func init() {
@@ -28,11 +30,14 @@ func init() {
}
var versionCmd = &cobra.Command{
- Use: "version",
- SuggestFor: []string {"edition", "release"},
- Short: "Print the version number of openwhisk-wskdeploy",
- Long: `Print the version number of openwhisk-wskdeploy`,
+ Use: "version",
+ SuggestFor: []string{"edition", "release"},
+ Short: wski18n.T(wski18n.ID_CMD_DESC_SHORT_VERSION),
Run: func(cmd *cobra.Command, args []string) {
- fmt.Printf("openwhisk-wskdeploy version is %s--%s\n", utils.Flags.CliBuild, utils.Flags.CliVersion)
+ wskprint.PrintlnOpenWhiskOutput(
+ // Note: no need to translate the following string
+ fmt.Sprintf("wskdeploy build-version: %s--%s",
+ utils.Flags.CliBuild,
+ utils.Flags.CliVersion))
},
}
diff --git a/deployers/deploymentreader.go b/deployers/deploymentreader.go
index 8370f8e0..d4908653 100644
--- a/deployers/deploymentreader.go
+++ b/deployers/deploymentreader.go
@@ -18,13 +18,13 @@
package deployers
import (
- "errors"
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/parsers"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
"github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
"github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
"github.com/apache/incubator-openwhisk-wskdeploy/wskenv"
+ "github.com/apache/incubator-openwhisk-wskdeploy/utils"
)
type DeploymentReader struct {
@@ -76,8 +76,13 @@ func (reader *DeploymentReader) bindPackageInputsAndAnnotations() error {
// a single package is specified in deployment YAML file with "package" key
if len(reader.DeploymentDescriptor.GetProject().Package.Packagename) != 0 {
packMap[reader.DeploymentDescriptor.GetProject().Package.Packagename] = reader.DeploymentDescriptor.GetProject().Package
- // TODO() i18n
- wskprint.PrintlnOpenWhiskWarning("The package YAML key in deployment file will soon be deprecated. Please use packages instead as described in specifications.")
+ warningString := wski18n.T(
+ wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
+ map[string]interface{}{
+ wski18n.KEY_OLD: parsers.YAML_KEY_PACKAGE,
+ wski18n.KEY_NEW: parsers.YAML_KEY_PACKAGES,
+ wski18n.KEY_FILE_TYPE: wski18n.DEPLOYMENT})
+ wskprint.PrintlnOpenWhiskWarning(warningString)
} else {
if reader.DeploymentDescriptor.Packages != nil {
for packName, depPacks := range reader.DeploymentDescriptor.Packages {
@@ -100,8 +105,12 @@ func (reader *DeploymentReader) bindPackageInputsAndAnnotations() error {
serviceDeployPack := reader.serviceDeployer.Deployment.Packages[packName]
if serviceDeployPack == nil {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskWarning("Package name in deployment file " + packName + " does not match with manifest file.")
+ warningString := wski18n.T(
+ wski18n.ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: wski18n.PACKAGE_NAME,
+ wski18n.KEY_NAME: packName })
+ wskprint.PrintlnOpenWhiskWarning(warningString)
break
}
@@ -149,10 +158,13 @@ func (reader *DeploymentReader) bindPackageInputsAndAnnotations() error {
}
}
if !keyExistsInManifest {
- // TODO() i18n, need to use an ID
- // TODO() fix grammar error; need command before "but"
- err := errors.New(wski18n.T("Annotation key \"" + name + "\" does not exist in manifest file but specified in deployment file."))
- return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, err)
+ warningString := wski18n.T(
+ wski18n.ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_ANNOTATION,
+ wski18n.KEY_NAME: name })
+ wskprint.PrintlnOpenWhiskWarning(warningString)
+ return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, warningString)
}
}
}
@@ -240,9 +252,12 @@ func (reader *DeploymentReader) bindActionInputsAndAnnotations() error {
}
}
if !keyExistsInManifest {
- // TODO() i18n, need to use an ID
- err := errors.New(wski18n.T("Annotation key \"" + name + "\" does not exist in manifest file but specified in deployment file."))
- return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, err)
+ errMsg := wski18n.T(
+ wski18n.ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_ANNOTATION,
+ wski18n.KEY_NAME: name })
+ return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, errMsg)
}
}
}
@@ -300,9 +315,16 @@ func (reader *DeploymentReader) bindTriggerInputsAndAnnotations() error {
depParams[kv.Key] = kv
}
+ var traceMsg string
for _, keyVal := range wskTrigger.Parameters {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskOutput("Checking key " + keyVal.Key)
+ traceMsg = wski18n.T(
+ wski18n.ID_DEBUG_KEY_VERIFY_X_name_X_key_X,
+ map[string]interface{}{
+ wski18n.KEY_NAME: parsers.YAML_KEY_ANNOTATION,
+ wski18n.KEY_KEY: keyVal.Key})
+ wskprint.PrintOpenWhiskVerbose(utils.Flags.Verbose, traceMsg)
+
+ // TODO() verify logic and add Verbose/trace say "found" or "not found"
if _, exists := depParams[keyVal.Key]; !exists {
keyValArr = append(keyValArr, keyVal)
}
@@ -328,9 +350,12 @@ func (reader *DeploymentReader) bindTriggerInputsAndAnnotations() error {
}
}
if !keyExistsInManifest {
- // TODO() i18n, need to use an ID
- err := errors.New(wski18n.T("Annotation key \"" + name + "\" does not exist in manifest file but specified in deployment file."))
- return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, err)
+ errMsg := wski18n.T(
+ wski18n.ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X,
+ map[string]interface{}{
+ wski18n.KEY_KEY: parsers.YAML_KEY_ANNOTATION,
+ wski18n.KEY_NAME: name })
+ return wskderrors.NewYAMLFileFormatError(reader.DeploymentDescriptor.Filepath, errMsg)
}
}
}
diff --git a/deployers/filesystemreader.go b/deployers/filesystemreader.go
index 702da767..05d61374 100644
--- a/deployers/filesystemreader.go
+++ b/deployers/filesystemreader.go
@@ -28,6 +28,7 @@ import (
"github.com/apache/incubator-openwhisk-wskdeploy/utils"
"github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
"github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
)
// name of directory that can contain source code
@@ -46,26 +47,33 @@ func NewFileSystemReader(serviceDeployer *ServiceDeployer) *FileSystemReader {
func (reader *FileSystemReader) ReadProjectDirectory(manifest *parsers.YAML) ([]utils.ActionRecord, error) {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskOutput("Inspecting project directory for actions....")
+ // Inform user of what reader is doing
+ dbgMsg := wski18n.T(wski18n.ID_DEBUG_PROJECT_SEARCH_X_path_X_key_X,
+ map[string]interface{}{
+ wski18n.KEY_PATH: reader.serviceDeployer.ProjectPath,
+ wski18n.KEY_KEY: wski18n.ACTIONS})
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg)
projectPathCount, err := reader.getFilePathCount(reader.serviceDeployer.ProjectPath)
actions := make([]utils.ActionRecord, 0)
- if err != nil {
- return actions, err
- }
+
+ if err != nil {
+ return actions, err
+ }
err = filepath.Walk(reader.serviceDeployer.ProjectPath, func(fpath string, f os.FileInfo, err error) error {
if fpath != reader.serviceDeployer.ProjectPath {
pathCount, err := reader.getFilePathCount(fpath)
- if err != nil {
- return wskderrors.NewFileReadError(fpath, err.Error())
- }
+ if err != nil {
+ return wskderrors.NewFileReadError(fpath, err.Error())
+ }
if !f.IsDir() {
- if pathCount-projectPathCount == 1 || strings.HasPrefix(fpath, reader.serviceDeployer.ProjectPath+"/"+FileSystemSourceDirectoryName) {
+ if pathCount - projectPathCount == 1 || strings.HasPrefix(fpath, reader.serviceDeployer.ProjectPath + "/" + FileSystemSourceDirectoryName) {
ext := filepath.Ext(fpath)
+ // TODO(#692) do not hardcoded known extensions here, create a util that associates
+ // known extensions to runtime types
foundFile := false
switch ext {
case ".swift":
@@ -78,9 +86,9 @@ func (reader *FileSystemReader) ReadProjectDirectory(manifest *parsers.YAML) ([]
if foundFile == true {
_, action, err := reader.CreateActionFromFile(reader.serviceDeployer.ManifestPath, fpath)
- if err != nil {
- return wskderrors.NewFileReadError(fpath, err.Error())
- }
+ if err != nil {
+ return wskderrors.NewFileReadError(fpath, err.Error())
+ }
var record utils.ActionRecord
record.Action = action
@@ -90,9 +98,17 @@ func (reader *FileSystemReader) ReadProjectDirectory(manifest *parsers.YAML) ([]
actions = append(actions, record)
}
}
- } else if strings.HasPrefix(fpath, reader.serviceDeployer.ProjectPath+"/"+FileSystemSourceDirectoryName) {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskOutput("Searching directory " + filepath.Base(fpath) + " for action source code.")
+ } else if strings.HasPrefix(fpath, reader.serviceDeployer.ProjectPath + "/" + FileSystemSourceDirectoryName) {
+ // Inform user of what reader is doing
+ dbgMsg := wski18n.T(wski18n.ID_DEBUG_PROJECT_SEARCH_X_path_X_key_X,
+ map[string]interface{}{
+ wski18n.KEY_PATH: filepath.Base(fpath),
+ wski18n.KEY_KEY: wski18n.ACTION_CODE})
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, dbgMsg)
+
+ // TODO(#694) It appears there is no code to do what the debug message suggests
+ // TODO(#694) continued: i.e., searching for Action code...
+
} else {
return filepath.SkipDir
}
@@ -115,6 +131,7 @@ func (reader *FileSystemReader) CreateActionFromFile(manipath, filePath string)
name := strings.TrimSuffix(baseName, filepath.Ext(baseName))
action := new(whisk.Action)
+ // TODO(#692) same TODO as above, that is create util for matching exts. to runtimes in common util pkg.
// process source code files
if ext == ".swift" || ext == ".js" || ext == ".py" {
@@ -130,9 +147,9 @@ func (reader *FileSystemReader) CreateActionFromFile(manipath, filePath string)
}
dat, err := new(utils.ContentReader).LocalReader.ReadLocal(filePath)
- if err != nil {
- return name, action, wskderrors.NewFileReadError(filePath, err.Error())
- }
+ if err != nil {
+ return name, action, wskderrors.NewFileReadError(filePath, err.Error())
+ }
action.Exec = new(whisk.Exec)
code := string(dat)
@@ -143,6 +160,8 @@ func (reader *FileSystemReader) CreateActionFromFile(manipath, filePath string)
action.Publish = &pub
return name, action, nil
}
+
+ // TODO(#691) create new named error
// If the action is not supported, we better to return an error.
return "", nil, errors.New("Unsupported action type.")
}
@@ -173,6 +192,7 @@ func (reader *FileSystemReader) SetFileActions(actions []utils.ActionRecord) err
existAction.Action.Exec.Code = fileAction.Action.Exec.Code
existAction.Filepath = fileAction.Filepath
} else {
+ // TODO(#691) create new named error
// Action exists, but references two different sources
return errors.New("Conflict detected for action named " + existAction.Action.Name + ". Found two locations for source file: " + existAction.Filepath + " and " + fileAction.Filepath)
}
@@ -183,5 +203,4 @@ func (reader *FileSystemReader) SetFileActions(actions []utils.ActionRecord) err
}
return nil
-
}
diff --git a/deployers/manifestreader_test.go b/deployers/manifestreader_test.go
index 646c2286..5e5851a1 100644
--- a/deployers/manifestreader_test.go
+++ b/deployers/manifestreader_test.go
@@ -57,5 +57,5 @@ func TestManifestReader_param(t *testing.T) {
err := mr.InitRootPackage(ps, ms, whisk.KeyValue{})
assert.Equal(t, err, nil, "Init Root Package failed")
- // TODO.
+ // TODO(#695) Is there more to do here? Original author left a TODO here in comments
}
diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index b382af5c..72f3540f 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -37,8 +37,8 @@ import (
)
const (
- CONFLICT_CODE = 153
CONFLICT_MESSAGE = "Concurrent modification to resource detected"
+ CONFLICT_CODE = 153
DEFAULT_ATTEMPTS = 3
DEFAULT_INTERVAL = 1 * time.Second
)
@@ -142,8 +142,8 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error {
// OpenWhisk entities are annotated with Project Name and therefore
// Project Name in manifest/deployment file is mandatory for managed deployments
if deployer.ProjectName == "" {
- errmsg := wski18n.T(wski18n.ID_ERR_MISSING_MANDATORY_KEY_X_key_X,
- map[string]interface{}{"key": parsers.PROJECT_NAME})
+ errmsg := wski18n.T(wski18n.ID_ERR_KEY_MISSING_X_key_X,
+ map[string]interface{}{wski18n.KEY_KEY: wski18n.PROJECT_NAME})
return wskderrors.NewYAMLFileFormatError(manifest.Filepath, errmsg)
}
@@ -177,13 +177,13 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error {
projectName = manifest.GetProject().Name
}
- // (TODO) delete this warning after deprecating application in manifest file
+ // TODO(#696) delete this warning after deprecating application in manifest file
if manifest.Application.Name != "" {
- wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
map[string]interface{}{
- "oldkey": parsers.YAML_KEY_APPLICATION,
- "newkey": parsers.YAML_KEY_PROJECT,
- "filetype": "manifest"}))
+ wski18n.KEY_OLD: parsers.YAML_KEY_APPLICATION,
+ wski18n.KEY_NEW: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_FILE_TYPE: wski18n.MANIFEST}))
}
// process deployment file
@@ -195,26 +195,26 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error {
return err
}
- // (TODO) delete this warning after deprecating application in deployment file
+ // TODO(#696) delete this warning after deprecating application in deployment file
if deploymentReader.DeploymentDescriptor.Application.Name != "" {
- wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
map[string]interface{}{
- "oldkey": parsers.YAML_KEY_APPLICATION,
- "newkey": parsers.YAML_KEY_PROJECT,
- "filetype": "deployment"}))
+ wski18n.KEY_OLD: parsers.YAML_KEY_APPLICATION,
+ wski18n.KEY_NEW: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_FILE_TYPE: wski18n.DEPLOYMENT}))
}
// compare the name of the project
if len(deploymentReader.DeploymentDescriptor.GetProject().Packages) != 0 && len(projectName) != 0 {
projectNameDeploy := deploymentReader.DeploymentDescriptor.GetProject().Name
if projectNameDeploy != projectName {
- errorString := wski18n.T(wski18n.ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X,
+ errorString := wski18n.T(wski18n.ID_ERR_NAME_MISMATCH_X_key_X_dname_X_dpath_X_mname_X_moath_X,
map[string]interface{}{
- "key": parsers.YAML_KEY_PROJECT,
- "dname": projectNameDeploy,
- "dpath": deployer.DeploymentPath,
- "mname": projectName,
- "mpath": deployer.ManifestPath})
+ wski18n.KEY_KEY: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_DEPLOYMENT_NAME: projectNameDeploy,
+ wski18n.KEY_DEPLOYMENT_PATH: deployer.DeploymentPath,
+ wski18n.KEY_MANIFEST_NAME: projectName,
+ wski18n.KEY_MANIFEST_PATH: deployer.ManifestPath})
return wskderrors.NewYAMLFileFormatError(manifest.Filepath, errorString)
}
}
@@ -265,13 +265,13 @@ func (deployer *ServiceDeployer) ConstructUnDeploymentPlan() (*DeploymentProject
projectName = manifest.GetProject().Name
}
- // (TODO) delete this warning after deprecating application in manifest file
+ // TODO(#696) delete this warning after deprecating application in manifest file
if manifest.Application.Name != "" {
- wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
map[string]interface{}{
- "oldkey": parsers.YAML_KEY_APPLICATION,
- "newkey": parsers.YAML_KEY_PROJECT,
- "filetype": "manifest"}))
+ wski18n.KEY_OLD: parsers.YAML_KEY_APPLICATION,
+ wski18n.KEY_NEW: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_FILE_TYPE: wski18n.MANIFEST}))
}
// process deployment file
@@ -282,26 +282,26 @@ func (deployer *ServiceDeployer) ConstructUnDeploymentPlan() (*DeploymentProject
return deployer.Deployment, err
}
- // (TODO) delete this warning after deprecating application in deployment file
+ // TODO(#696) delete this warning after deprecating application in deployment file
if deploymentReader.DeploymentDescriptor.Application.Name != "" {
- wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
map[string]interface{}{
- "oldkey": parsers.YAML_KEY_APPLICATION,
- "newkey": parsers.YAML_KEY_PROJECT,
- "filetype": "deployment"}))
+ wski18n.KEY_OLD: parsers.YAML_KEY_APPLICATION,
+ wski18n.KEY_NEW: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_FILE_TYPE: wski18n.DEPLOYMENT}))
}
// compare the name of the application
if len(deploymentReader.DeploymentDescriptor.GetProject().Packages) != 0 && len(projectName) != 0 {
projectNameDeploy := deploymentReader.DeploymentDescriptor.GetProject().Name
if projectNameDeploy != projectName {
- errorString := wski18n.T(wski18n.ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X,
+ errorString := wski18n.T(wski18n.ID_ERR_NAME_MISMATCH_X_key_X_dname_X_dpath_X_mname_X_moath_X,
map[string]interface{}{
- "key": parsers.YAML_KEY_PROJECT,
- "dname": projectNameDeploy,
- "dpath": deployer.DeploymentPath,
- "mname": projectName,
- "mpath": deployer.ManifestPath})
+ wski18n.KEY_KEY: parsers.YAML_KEY_PROJECT,
+ wski18n.KEY_DEPLOYMENT_NAME: projectNameDeploy,
+ wski18n.KEY_DEPLOYMENT_PATH: deployer.DeploymentPath,
+ wski18n.KEY_MANIFEST_NAME: projectName,
+ wski18n.KEY_MANIFEST_PATH: deployer.ManifestPath})
return deployer.Deployment, wskderrors.NewYAMLFileFormatError(manifest.Filepath, errorString)
}
}
@@ -414,7 +414,7 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
for _, pack := range deployer.Deployment.Packages {
for depName, depRecord := range pack.Dependencies {
output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYING_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgInfo, output)
if depRecord.IsBinding {
@@ -438,7 +438,7 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
return error
} else {
output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgInfo, output)
}
@@ -455,7 +455,7 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
if err := depServiceDeployer.deployAssets(); err != nil {
errString := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_FAILURE_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
wskprint.PrintOpenWhiskError(errString)
return err
}
@@ -484,7 +484,7 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
return err
} else {
output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgInfo, output)
}
}
@@ -583,9 +583,9 @@ func (deployer *ServiceDeployer) RefreshManagedTriggers(ma map[string]interface{
// we have found a trigger which was earlier part of the current project
output := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
map[string]interface{}{
- "key": parsers.YAML_KEY_TRIGGER,
- "name": trigger.Name,
- "project": ma[utils.OW_PROJECT_NAME]})
+ wski18n.KEY_KEY: parsers.YAML_KEY_TRIGGER,
+ wski18n.KEY_NAME: trigger.Name,
+ wski18n.KEY_PROJECT: ma[utils.OW_PROJECT_NAME]})
wskprint.PrintOpenWhiskWarning(output)
var err error
@@ -635,9 +635,9 @@ func (deployer *ServiceDeployer) RefreshManagedPackages(ma map[string]interface{
if pa[utils.OW_PROJECT_NAME] == ma[utils.OW_PROJECT_NAME] && pa[utils.OW_PROJECT_HASH] != ma[utils.OW_PROJECT_HASH] {
output := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
map[string]interface{}{
- "key": parsers.YAML_KEY_PACKAGE,
- "name": pkg.Name,
- "project": pa[utils.OW_PROJECT_NAME]})
+ wski18n.KEY_KEY: parsers.YAML_KEY_PACKAGE,
+ wski18n.KEY_NAME: pkg.Name,
+ wski18n.KEY_PROJECT: pa[utils.OW_PROJECT_NAME]})
wskprint.PrintOpenWhiskWarning(output)
var err error
@@ -738,7 +738,7 @@ func (deployer *ServiceDeployer) DeployApis() error {
func (deployer *ServiceDeployer) createBinding(packa *whisk.BindingPackage) error {
- displayPreprocessingInfo("package binding", packa.Name, true)
+ displayPreprocessingInfo(wski18n.PACKAGE_BINDING, packa.Name, true)
var err error
var response *http.Response
@@ -748,10 +748,10 @@ func (deployer *ServiceDeployer) createBinding(packa *whisk.BindingPackage) erro
})
if err != nil {
- return createWhiskClientError(err.(*whisk.WskError), response, "package binding", true)
+ return createWhiskClientError(err.(*whisk.WskError), response, wski18n.PACKAGE_BINDING, true)
}
- displayPostprocessingInfo(parsers.PACKAGE_BINDING, packa.Name, true)
+ displayPostprocessingInfo(wski18n.PACKAGE_BINDING, packa.Name, true)
return nil
}
@@ -793,7 +793,7 @@ func (deployer *ServiceDeployer) createTrigger(trigger *whisk.Trigger) error {
func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedName string) error {
- displayPreprocessingInfo(parsers.TRIGGER_FEED, trigger.Name, true)
+ displayPreprocessingInfo(wski18n.TRIGGER_FEED, trigger.Name, true)
// to hold and modify trigger parameters, not passed by ref?
params := make(map[string]interface{})
@@ -803,7 +803,7 @@ func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedNa
params[keyVal.Key] = keyVal.Value
}
- // TODO() defone keys and lifecylce operation names as const
+ // TODO() define keys and lifecycle operation names as const
params["authKey"] = deployer.ClientConfig.AuthToken
params["lifecycleEvent"] = "CREATE"
params["triggerName"] = "/" + deployer.Client.Namespace + "/" + trigger.Name
@@ -834,7 +834,7 @@ func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedNa
return err
})
if err != nil {
- return createWhiskClientError(err.(*whisk.WskError), response, parsers.TRIGGER_FEED, true)
+ return createWhiskClientError(err.(*whisk.WskError), response, wski18n.TRIGGER_FEED, true)
} else {
qName, err := utils.ParseQualifiedName(feedName, deployer.ClientConfig.Namespace)
@@ -859,11 +859,11 @@ func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedNa
return err
})
- return createWhiskClientError(err.(*whisk.WskError), response, parsers.TRIGGER_FEED, false)
+ return createWhiskClientError(err.(*whisk.WskError), response, wski18n.TRIGGER_FEED, false)
}
}
- displayPostprocessingInfo(parsers.TRIGGER_FEED, trigger.Name, true)
+ displayPostprocessingInfo(wski18n.TRIGGER_FEED, trigger.Name, true)
return nil
}
@@ -1022,7 +1022,7 @@ func (deployer *ServiceDeployer) UnDeployDependencies() error {
for _, pack := range deployer.Deployment.Packages {
for depName, depRecord := range pack.Dependencies {
output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgInfo, output)
if depRecord.IsBinding {
@@ -1056,20 +1056,20 @@ func (deployer *ServiceDeployer) UnDeployDependencies() error {
return err
})
if err != nil {
- return createWhiskClientError(err.(*whisk.WskError), response, parsers.PACKAGE_BINDING, false)
+ return createWhiskClientError(err.(*whisk.WskError), response, wski18n.PACKAGE_BINDING, false)
}
}
}
if err := depServiceDeployer.unDeployAssets(plan); err != nil {
errString := wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYMENT_FAILURE_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgError, errString)
return err
}
}
output = wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X,
- map[string]interface{}{"name": depName})
+ map[string]interface{}{wski18n.KEY_NAME: depName})
whisk.Debug(whisk.DbgInfo, output)
}
}
@@ -1217,7 +1217,7 @@ func (deployer *ServiceDeployer) deleteFeedAction(trigger *whisk.Trigger, feedNa
if err != nil {
wskErr := err.(*whisk.WskError)
errString := wski18n.T(wski18n.ID_ERR_FEED_INVOKE_X_err_X_code_X,
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
+ map[string]interface{}{wski18n.KEY_ERR: wskErr.Error(), wski18n.KEY_CODE: strconv.Itoa(wskErr.ExitCode)})
whisk.Debug(whisk.DbgError, errString)
return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
@@ -1293,8 +1293,11 @@ func retry(attempts int, sleep time.Duration, callback func() error) error {
wskErr := err.(*whisk.WskError)
if wskErr.ExitCode == CONFLICT_CODE && strings.Contains(wskErr.Error(), CONFLICT_MESSAGE) {
time.Sleep(sleep)
- // TODO() i18n
- whisk.Debug(whisk.DbgError, "Retrying [%s] after error: %s\n", strconv.Itoa(i+1), err)
+ warningMsg := wski18n.T(wski18n.ID_WARN_COMMAND_RETRY,
+ map[string]interface{}{
+ wski18n.KEY_CMD: strconv.Itoa(i+1),
+ wski18n.KEY_ERR: err.Error()})
+ wskprint.PrintlnOpenWhiskWarning(warningMsg)
} else {
return err
}
@@ -1460,9 +1463,9 @@ func displayPreprocessingInfo(entity string, name string, onDeploy bool){
}
msg := wski18n.T(msgKey,
map[string]interface{}{
- "key": entity,
- "name": name})
- whisk.Debug(whisk.DbgInfo, msg)
+ wski18n.KEY_KEY: entity,
+ wski18n.KEY_NAME: name})
+ wskprint.PrintlnOpenWhiskInfo(msg)
}
func displayPostprocessingInfo(entity string, name string, onDeploy bool){
@@ -1473,27 +1476,27 @@ func displayPostprocessingInfo(entity string, name string, onDeploy bool){
} else {
msgKey = wski18n.ID_MSG_ENTITY_UNDEPLOYED_SUCCESS_X_key_X_name_X
}
- errString := wski18n.T(msgKey,
+ msg := wski18n.T(msgKey,
map[string]interface{}{
- "key": entity,
- "name": name})
- whisk.Debug(whisk.DbgInfo, errString)
+ wski18n.KEY_KEY: entity,
+ wski18n.KEY_NAME: name})
+ wskprint.PrintlnOpenWhiskInfo(msg)
}
func createWhiskClientError(err *whisk.WskError, response *http.Response, entity string, onCreate bool)(*wskderrors.WhiskClientError){
var msgKey string
if onCreate{
- msgKey = wski18n.ID_ERR_CREATE_ENTITY_X_key_X_err_X_code_X
+ msgKey = wski18n.ID_ERR_ENTITY_CREATE_X_key_X_err_X_code_X
} else {
- msgKey = wski18n.ID_ERR_DELETE_ENTITY_X_key_X_err_X_code_X
+ msgKey = wski18n.ID_ERR_ENTITY_DELETE_X_key_X_err_X_code_X
}
errString := wski18n.T(msgKey,
map[string]interface{}{
- "key": entity,
- "err": err.Error(),
- "code": strconv.Itoa(err.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
+ wski18n.KEY_KEY: entity,
+ wski18n.KEY_ERR: err.Error(),
+ wski18n.KEY_CODE: strconv.Itoa(err.ExitCode)})
+ wskprint.PrintOpenWhiskVerbose(utils.Flags.Verbose, errString)
// TODO() add errString as an AppendDetail() to WhiskClientError
return wskderrors.NewWhiskClientError(err.Error(), err.ExitCode, response)
diff --git a/deployers/verifier.go b/deployers/verifier.go
index a956ee9a..47438153 100644
--- a/deployers/verifier.go
+++ b/deployers/verifier.go
@@ -49,6 +49,7 @@ func (vf *Verifier) Query(deployer *ServiceDeployer) (da *DeploymentProject, err
return da, nil
}
+// TODO() function supposedly returns an error, but never does
func (vf *Verifier) Filter(deployer *ServiceDeployer, target *DeploymentProject) (rs *DeploymentProject, err error) {
//substract
for _, pa := range target.Packages {
@@ -67,6 +68,8 @@ func (vf *Verifier) Filter(deployer *ServiceDeployer, target *DeploymentProject)
}
// Convert whisk.package to whisk.SentPackageNoPublish
+// TODO() function supposedly returns an error, but never does
+// TODO() return value named "sentpackage" is instead "sp"
func convert(pa *whisk.Package) (sentpackage *whisk.Package, err error) {
sp := &whisk.Package{}
sp.Name = pa.Name
diff --git a/deployers/whiskclient.go b/deployers/whiskclient.go
index 64dba3d1..715750ce 100644
--- a/deployers/whiskclient.go
+++ b/deployers/whiskclient.go
@@ -34,12 +34,12 @@ import (
"github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
)
+// Possible sources for config info (e.g., API Host, Auth Key, Namespace)
const (
- COMMANDLINE = "wskdeploy command line"
- DEFAULTVALUE = "default value"
- WSKPROPS = ".wskprops"
- WHISKPROPERTY = "whisk.properties"
- INTERINPUT = "interactve input"
+ SOURCE_WSKPROPS = ".wskprops"
+ SOURCE_WHISK_PROPERTIES = "whisk.properties"
+ SOURCE_INTERACTIVE_INPUT = "interactve input" // TODO() i18n?
+ SOURCE_DEFAULT_VALUE = "wskdeploy default" // TODO() i18n?
)
type PropertyValue struct {
@@ -90,38 +90,64 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
// read credentials from command line
apihost, auth, ns, keyfile, certfile := GetCommandLineFlags()
- credential = GetPropertyValue(credential, auth, COMMANDLINE)
- namespace = GetPropertyValue(namespace, ns, COMMANDLINE)
- apiHost = GetPropertyValue(apiHost, apihost, COMMANDLINE)
- key = GetPropertyValue(key, keyfile, COMMANDLINE)
- cert = GetPropertyValue(cert, certfile, COMMANDLINE)
-
+ credential = GetPropertyValue(credential, auth, wski18n.COMMAND_LINE)
+ namespace = GetPropertyValue(namespace, ns, wski18n.COMMAND_LINE)
+ apiHost = GetPropertyValue(apiHost, apihost, wski18n.COMMAND_LINE)
+ key = GetPropertyValue(key, keyfile, wski18n.COMMAND_LINE)
+ cert = GetPropertyValue(cert, certfile, wski18n.COMMAND_LINE)
+
+ // TODO() i18n
+ // Print all flags / values if verbose
+ wskprint.PrintlnOpenWhiskVerbose(utils.Flags.Verbose, wski18n.CONFIGURATION + ":\n" + utils.Flags.Format())
+
+ // TODO() split this logic into its own function
+ // TODO() merge with the same logic used against manifest file (below)
// now, read them from deployment file if not found on command line
if len(credential.Value) == 0 || len(namespace.Value) == 0 || len(apiHost.Value) == 0 {
if utils.FileExists(deploymentPath) {
mm := parsers.NewYAMLParser()
deployment, _ := mm.ParseDeployment(deploymentPath)
- credential = GetPropertyValue(credential, deployment.GetProject().Credential, path.Base(deploymentPath))
- namespace = GetPropertyValue(namespace, deployment.GetProject().Namespace, path.Base(deploymentPath))
- apiHost = GetPropertyValue(apiHost, deployment.GetProject().ApiHost, path.Base(deploymentPath))
+ credential = GetPropertyValue(credential,
+ deployment.GetProject().Credential,
+ path.Base(deploymentPath))
+ namespace = GetPropertyValue(namespace,
+ deployment.GetProject().Namespace,
+ path.Base(deploymentPath))
+ apiHost = GetPropertyValue(apiHost,
+ deployment.GetProject().ApiHost,
+ path.Base(deploymentPath))
}
}
+ // TODO() split this logic into its own function
+ // TODO() merge with the same logic used against deployment file (above)
// read credentials from manifest file as didn't find them on command line and in deployment file
if len(credential.Value) == 0 || len(namespace.Value) == 0 || len(apiHost.Value) == 0 {
if utils.FileExists(manifestPath) {
mm := parsers.NewYAMLParser()
manifest, _ := mm.ParseManifest(manifestPath)
if manifest.Package.Packagename != "" {
- credential = GetPropertyValue(credential, manifest.Package.Credential, path.Base(manifestPath))
- namespace = GetPropertyValue(namespace, manifest.Package.Namespace, path.Base(manifestPath))
- apiHost = GetPropertyValue(apiHost, manifest.Package.ApiHost, path.Base(manifestPath))
+ credential = GetPropertyValue(credential,
+ manifest.Package.Credential,
+ path.Base(manifestPath))
+ namespace = GetPropertyValue(namespace,
+ manifest.Package.Namespace,
+ path.Base(manifestPath))
+ apiHost = GetPropertyValue(apiHost,
+ manifest.Package.ApiHost,
+ path.Base(manifestPath))
} else if manifest.Packages != nil {
if len(manifest.Packages) == 1 {
for _, pkg := range manifest.Packages {
- credential = GetPropertyValue(credential, pkg.Credential, path.Base(manifestPath))
- namespace = GetPropertyValue(namespace, pkg.Namespace, path.Base(manifestPath))
- apiHost = GetPropertyValue(apiHost, pkg.ApiHost, path.Base(manifestPath))
+ credential = GetPropertyValue(credential,
+ pkg.Credential,
+ path.Base(manifestPath))
+ namespace = GetPropertyValue(namespace,
+ pkg.Namespace,
+ path.Base(manifestPath))
+ apiHost = GetPropertyValue(apiHost,
+ pkg.ApiHost,
+ path.Base(manifestPath))
}
}
}
@@ -135,42 +161,42 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
// The error raised here can be neglected, because we will handle it in the end of this function.
wskprops, _ := GetWskPropFromWskprops(pi, proppath)
- credential = GetPropertyValue(credential, wskprops.AuthKey, WSKPROPS)
- namespace = GetPropertyValue(namespace, wskprops.Namespace, WSKPROPS)
- apiHost = GetPropertyValue(apiHost, wskprops.APIHost, WSKPROPS)
- key = GetPropertyValue(key, wskprops.Key, WSKPROPS)
- cert = GetPropertyValue(cert, wskprops.Cert, WSKPROPS)
+ credential = GetPropertyValue(credential, wskprops.AuthKey, SOURCE_WSKPROPS)
+ namespace = GetPropertyValue(namespace, wskprops.Namespace, SOURCE_WSKPROPS)
+ apiHost = GetPropertyValue(apiHost, wskprops.APIHost, SOURCE_WSKPROPS)
+ key = GetPropertyValue(key, wskprops.Key, SOURCE_WSKPROPS)
+ cert = GetPropertyValue(cert, wskprops.Cert, SOURCE_WSKPROPS)
// TODO() see if we can split the following whisk prop logic into a separate function
// now, read credentials from whisk.properties but this is only acceptable within Travis
// whisk.properties will soon be deprecated and should not be used for any production deployment
whiskproperty, _ := GetWskPropFromWhiskProperty(pi)
- var warnmsg string
+ var warnMsg string
- credential = GetPropertyValue(credential, whiskproperty.AuthKey, WHISKPROPERTY)
- if credential.Source == WHISKPROPERTY {
- warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
- map[string]interface{}{"key": "authenticaton key"})
- wskprint.PrintlnOpenWhiskWarning(warnmsg)
+ credential = GetPropertyValue(credential, whiskproperty.AuthKey, SOURCE_WHISK_PROPERTIES)
+ if credential.Source == SOURCE_WHISK_PROPERTIES {
+ warnMsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{wski18n.KEY_KEY: wski18n.AUTH_KEY})
+ wskprint.PrintlnOpenWhiskWarning(warnMsg)
}
- namespace = GetPropertyValue(namespace, whiskproperty.Namespace, WHISKPROPERTY)
- if namespace.Source == WHISKPROPERTY {
- warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
- map[string]interface{}{"key": "namespace"})
- wskprint.PrintlnOpenWhiskWarning(warnmsg)
+ namespace = GetPropertyValue(namespace, whiskproperty.Namespace, SOURCE_WHISK_PROPERTIES)
+ if namespace.Source == SOURCE_WHISK_PROPERTIES {
+ warnMsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{wski18n.KEY_KEY: parsers.YAML_KEY_NAMESPACE})
+ wskprint.PrintlnOpenWhiskWarning(warnMsg)
}
- apiHost = GetPropertyValue(apiHost, whiskproperty.APIHost, WHISKPROPERTY)
- if apiHost.Source == WHISKPROPERTY {
- warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
- map[string]interface{}{"key": "API host"})
- wskprint.PrintlnOpenWhiskWarning(warnmsg)
+ apiHost = GetPropertyValue(apiHost, whiskproperty.APIHost, SOURCE_WHISK_PROPERTIES)
+ if apiHost.Source == SOURCE_WHISK_PROPERTIES {
+ warnMsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{wski18n.KEY_KEY: wski18n.API_HOST})
+ wskprint.PrintlnOpenWhiskWarning(warnMsg)
}
// set namespace to default namespace if not yet found
if len(apiHost.Value) != 0 && len(credential.Value) != 0 && len(namespace.Value) == 0 {
namespace.Value = whisk.DEFAULT_NAMESPACE
- namespace.Source = DEFAULTVALUE
+ namespace.Source = SOURCE_DEFAULT_VALUE
}
// TODO() See if we can split off the interactive logic into a separate function
@@ -185,22 +211,23 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
host = "openwhisk.ng.bluemix.net"
}
apiHost.Value = host
- apiHost.Source = INTERINPUT
+ apiHost.Source = SOURCE_INTERACTIVE_INPUT
}
if len(credential.Value) == 0 && isInteractive == true {
cred := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_AUTHKEY))
credential.Value = cred
- credential.Source = INTERINPUT
+ credential.Source = SOURCE_INTERACTIVE_INPUT
- // The namespace is always associated with the credential. Both of them should be picked up from the same source.
+ // The namespace is always associated with the credential.
+ // Both of them should be picked up from the same source.
if len(namespace.Value) == 0 || namespace.Value == whisk.DEFAULT_NAMESPACE {
tempNamespace := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_NAMESPACE))
- source := INTERINPUT
+ source := SOURCE_INTERACTIVE_INPUT
if tempNamespace == "" {
tempNamespace = whisk.DEFAULT_NAMESPACE
- source = DEFAULTVALUE
+ source = SOURCE_DEFAULT_VALUE
}
namespace.Value = tempNamespace
@@ -217,7 +244,7 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
AuthToken: credential.Value, //Authtoken
Namespace: namespace.Value, //Namespace
Host: apiHost.Value,
- Version: "v1",
+ Version: "v1", // TODO() should not be hardcoded, should prompt/warn user of default
Cert: cert.Value,
Key: key.Value,
Insecure: mode, // true if you want to ignore certificate signing
@@ -225,7 +252,6 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
// validate we have credential, apihost and namespace
err := validateClientConfig(credential, apiHost, namespace)
-
return clientConfig, err
}
@@ -251,21 +277,21 @@ func validateClientConfig(credential PropertyValue, apiHost PropertyValue, names
// Show caller what final values we used for credential, apihost and namespace
stdout := wski18n.T(wski18n.ID_MSG_CONFIG_INFO_APIHOST_X_host_X_source_X,
- map[string]interface{}{"host": apiHost.Value, "source": apiHost.Source})
- wskprint.PrintOpenWhiskStatus(stdout)
+ map[string]interface{}{wski18n.KEY_HOST: apiHost.Value, wski18n.KEY_SOURCE: apiHost.Source})
+ wskprint.PrintOpenWhiskInfo(stdout)
stdout = wski18n.T(wski18n.ID_MSG_CONFIG_INFO_AUTHKEY_X_source_X,
- map[string]interface{}{"source": credential.Source})
- wskprint.PrintOpenWhiskStatus(stdout)
+ map[string]interface{}{wski18n.KEY_SOURCE: credential.Source})
+ wskprint.PrintOpenWhiskInfo(stdout)
stdout = wski18n.T(wski18n.ID_MSG_CONFIG_INFO_NAMESPACE_X_namespace_X_source_X,
- map[string]interface{}{"namespace": namespace.Value, "source": namespace.Source})
- wskprint.PrintOpenWhiskStatus(stdout)
+ map[string]interface{}{wski18n.KEY_NAMESPACE: namespace.Value, wski18n.KEY_SOURCE: namespace.Source})
+ wskprint.PrintOpenWhiskInfo(stdout)
return nil
}
-// TODO() move into its own package "wskread" and add support for passing in default value
+// TODO() perhaps move into its own package "wskread" and add support for passing in default value
var promptForValue = func(msg string) (string) {
reader := bufio.NewReader(os.Stdin)
fmt.Print(msg)
diff --git a/deployers/whiskclient_test.go b/deployers/whiskclient_test.go
index fca94295..5f81e035 100644
--- a/deployers/whiskclient_test.go
+++ b/deployers/whiskclient_test.go
@@ -43,16 +43,16 @@ const (
WSKPROPS_AUTH = "a4f8c502:123zO3xZCLrMN6v2BKK"
WSKPROPS_NAMESPACE = "guest"
- WSKPROPS_KEY = "test_key_file"
- WSKPROPS_CERT = "test_cert_file"
+ WSKPROPS_KEY = "test_key_file"
+ WSKPROPS_CERT = "test_cert_file"
)
func initializeFlags() {
- utils.Flags.Auth = ""
- utils.Flags.Namespace = ""
- utils.Flags.ApiHost = ""
- utils.Flags.Key = ""
- utils.Flags.Cert = ""
+ utils.Flags.Auth = ""
+ utils.Flags.Namespace = ""
+ utils.Flags.ApiHost = ""
+ utils.Flags.Key = ""
+ utils.Flags.Cert = ""
}
func TestNewWhiskConfig(t *testing.T) {
@@ -61,7 +61,7 @@ func TestNewWhiskConfig(t *testing.T) {
deploymentPath := ""
config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
if err == nil {
- pi := whisk.PropertiesImp {
+ pi := whisk.PropertiesImp{
OsPackage: whisk.OSPackageImp{},
}
wskprops, err := whisk.GetDefaultWskProp(pi)
@@ -85,23 +85,23 @@ func TestNewWhiskConfigCommandLine(t *testing.T) {
config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
assert.Nil(t, err, "Failed to read credentials from wskdeploy command line")
- assert.Equal(t, CLI_HOST, config.Host, "Failed to get host name from wskdeploy command line")
- assert.Equal(t, CLI_AUTH, config.AuthToken, "Failed to get auth token from wskdeploy command line")
- assert.Equal(t, CLI_NAMESPACE, config.Namespace, "Failed to get namespace from wskdeploy command line")
- assert.True(t, config.Insecure, "Config should set insecure to true")
-
- utils.Flags.Key = WSKPROPS_KEY
- utils.Flags.Cert = WSKPROPS_CERT
- config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
- assert.Nil(t, err, "Failed to read credentials from wskdeploy command line")
- assert.Equal(t, CLI_HOST, config.Host, "Failed to get host name from wskdeploy command line")
- assert.Equal(t, CLI_AUTH, config.AuthToken, "Failed to get auth token from wskdeploy command line")
- assert.Equal(t, CLI_NAMESPACE, config.Namespace, "Failed to get namespace from wskdeploy command line")
- assert.Equal(t, WSKPROPS_KEY, config.Key, "Failed to get key file from wskdeploy command line")
- assert.Equal(t, WSKPROPS_CERT, config.Cert, "Failed to get cert file from wskdeploy command line")
- assert.False(t, config.Insecure, "Config should set insecure to false")
-
- initializeFlags()
+ assert.Equal(t, CLI_HOST, config.Host, "Failed to get host name from wskdeploy command line")
+ assert.Equal(t, CLI_AUTH, config.AuthToken, "Failed to get auth token from wskdeploy command line")
+ assert.Equal(t, CLI_NAMESPACE, config.Namespace, "Failed to get namespace from wskdeploy command line")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
+
+ utils.Flags.Key = WSKPROPS_KEY
+ utils.Flags.Cert = WSKPROPS_CERT
+ config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
+ assert.Nil(t, err, "Failed to read credentials from wskdeploy command line")
+ assert.Equal(t, CLI_HOST, config.Host, "Failed to get host name from wskdeploy command line")
+ assert.Equal(t, CLI_AUTH, config.AuthToken, "Failed to get auth token from wskdeploy command line")
+ assert.Equal(t, CLI_NAMESPACE, config.Namespace, "Failed to get namespace from wskdeploy command line")
+ assert.Equal(t, WSKPROPS_KEY, config.Key, "Failed to get key file from wskdeploy command line")
+ assert.Equal(t, WSKPROPS_CERT, config.Cert, "Failed to get cert file from wskdeploy command line")
+ assert.False(t, config.Insecure, "Config should set insecure to false")
+
+ initializeFlags()
}
func TestNewWhiskConfigDeploymentFile(t *testing.T) {
@@ -113,7 +113,7 @@ func TestNewWhiskConfigDeploymentFile(t *testing.T) {
assert.Equal(t, DEPLOYMENT_HOST, config.Host, "Failed to get host name from deployment file")
assert.Equal(t, DEPLOYMENT_AUTH, config.AuthToken, "Failed to get auth token from deployment file")
assert.Equal(t, DEPLOYMENT_NAMESPACE, config.Namespace, "Failed to get namespace from deployment file")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
}
func TestNewWhiskConfigManifestFile(t *testing.T) {
@@ -125,10 +125,9 @@ func TestNewWhiskConfigManifestFile(t *testing.T) {
assert.Equal(t, MANIFEST_HOST, config.Host, "Failed to get host name from manifest file")
assert.Equal(t, MANIFEST_AUTH, config.AuthToken, "Failed to get auth token from manifest file")
assert.Equal(t, MANIFEST_NAMESPACE, config.Namespace, "Failed to get namespace from manifest file")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
}
-
func TestNewWhiskConfigWithWskProps(t *testing.T) {
propPath := "../tests/dat/wskprops"
manifestPath := ""
@@ -138,22 +137,22 @@ func TestNewWhiskConfigWithWskProps(t *testing.T) {
assert.Equal(t, WSKPROPS_HOST, config.Host, "Failed to get host name from wskprops")
assert.Equal(t, WSKPROPS_AUTH, config.AuthToken, "Failed to get auth token from wskprops")
assert.Equal(t, WSKPROPS_NAMESPACE, config.Namespace, "Failed to get namespace from wskprops")
- assert.Equal(t, WSKPROPS_KEY, config.Key, "Failed to get key file from wskprops")
- assert.Equal(t, WSKPROPS_CERT, config.Cert, "Failed to get cert file from wskprops")
- assert.False(t, config.Insecure, "Config should set insecure to false")
-
- propPath = "../tests/dat/wskpropsnokeycert"
- config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
- assert.Nil(t, err, "Failed to read credentials from wskprops")
- assert.Equal(t, WSKPROPS_HOST, config.Host, "Failed to get host name from wskprops")
- assert.Equal(t, WSKPROPS_AUTH, config.AuthToken, "Failed to get auth token from wskprops")
- assert.Equal(t, WSKPROPS_NAMESPACE, config.Namespace, "Failed to get namespace from wskprops")
- assert.Empty(t, config.Key, "Failed to get key file from wskprops")
- assert.Empty(t, config.Cert, "Failed to get cert file from wskprops")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.Equal(t, WSKPROPS_KEY, config.Key, "Failed to get key file from wskprops")
+ assert.Equal(t, WSKPROPS_CERT, config.Cert, "Failed to get cert file from wskprops")
+ assert.False(t, config.Insecure, "Config should set insecure to false")
+
+ propPath = "../tests/dat/wskpropsnokeycert"
+ config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, false)
+ assert.Nil(t, err, "Failed to read credentials from wskprops")
+ assert.Equal(t, WSKPROPS_HOST, config.Host, "Failed to get host name from wskprops")
+ assert.Equal(t, WSKPROPS_AUTH, config.AuthToken, "Failed to get auth token from wskprops")
+ assert.Equal(t, WSKPROPS_NAMESPACE, config.Namespace, "Failed to get namespace from wskprops")
+ assert.Empty(t, config.Key, "Failed to get key file from wskprops")
+ assert.Empty(t, config.Cert, "Failed to get cert file from wskprops")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
}
-// (TODO) add the following test
+// TODO(#693) add the following test
/*func TestNewWhiskConfigInteractiveMode(t *testing.T) {
propPath := ""
manifestPath := ""
@@ -176,12 +175,11 @@ func TestNewWhiskConfigWithCLIDeploymentAndManifestFile(t *testing.T) {
assert.Equal(t, config.Host, CLI_HOST, "Failed to get host name from wskdeploy CLI")
assert.Equal(t, config.AuthToken, CLI_AUTH, "Failed to get auth token from wskdeploy CLI")
assert.Equal(t, config.Namespace, CLI_NAMESPACE, "Failed to get namespace from wskdeploy CLI")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
- initializeFlags()
+ initializeFlags()
}
-
func TestNewWhiskConfigWithCLIAndDeployment(t *testing.T) {
propPath := ""
manifestPath := "../tests/dat/deployment_validate_credentials.yaml"
@@ -196,9 +194,9 @@ func TestNewWhiskConfigWithCLIAndDeployment(t *testing.T) {
assert.Equal(t, config.Host, CLI_HOST, "Failed to get host name from wskdeploy CLI")
assert.Equal(t, config.AuthToken, CLI_AUTH, "Failed to get auth token from wskdeploy CLI")
assert.Equal(t, config.Namespace, CLI_NAMESPACE, "Failed to get namespace from wskdeploy CLI")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
- initializeFlags()
+ initializeFlags()
}
func TestNewWhiskConfigWithCLIAndManifest(t *testing.T) {
@@ -215,9 +213,9 @@ func TestNewWhiskConfigWithCLIAndManifest(t *testing.T) {
assert.Equal(t, config.Host, CLI_HOST, "Failed to get host name from wskdeploy CLI")
assert.Equal(t, config.AuthToken, CLI_AUTH, "Failed to get auth token from wskdeploy CLI")
assert.Equal(t, config.Namespace, CLI_NAMESPACE, "Failed to get namespace from wskdeploy CLI")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
- initializeFlags()
+ initializeFlags()
}
func TestNewWhiskConfigWithCLIAndWskProps(t *testing.T) {
@@ -233,9 +231,9 @@ func TestNewWhiskConfigWithCLIAndWskProps(t *testing.T) {
assert.Equal(t, config.Host, CLI_HOST, "Failed to get host name from wskdeploy command line")
assert.Equal(t, config.AuthToken, CLI_AUTH, "Failed to get auth token from wskdeploy command line")
assert.Equal(t, config.Namespace, CLI_NAMESPACE, "Failed to get namespace from wskdeploy command line")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
- initializeFlags()
+ initializeFlags()
}
func TestNewWhiskConfigWithDeploymentAndManifestFile(t *testing.T) {
@@ -247,5 +245,5 @@ func TestNewWhiskConfigWithDeploymentAndManifestFile(t *testing.T) {
assert.Equal(t, config.Host, DEPLOYMENT_HOST, "Failed to get host name from deployment file")
assert.Equal(t, config.AuthToken, DEPLOYMENT_AUTH, "Failed to get auth token from deployment file")
assert.Equal(t, config.Namespace, DEPLOYMENT_NAMESPACE, "Failed to get namespace from deployment file")
- assert.True(t, config.Insecure, "Config should set insecure to true")
+ assert.True(t, config.Insecure, "Config should set insecure to true")
}
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 82a4b526..37d318e6 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -77,8 +77,6 @@ func (dm *YAMLParser) Unmarshal(input []byte, manifest *YAML) error {
func (dm *YAMLParser) marshal(manifest *YAML) (output []byte, err error) {
data, err := yaml.Marshal(manifest)
if err != nil {
- // TODO() i18n
- fmt.Printf("err happened during marshal :%v", err)
return nil, err
}
return data, nil
@@ -159,8 +157,8 @@ func (dm *YAMLParser) ComposeDependencies(pkg Package, projectPath string, fileP
isBinding = false
} else {
- // TODO() i18n
- return nil, errors.New("Dependency type is unknown. wskdeploy only supports /whisk.system bindings or github.com packages.")
+ // TODO() create new named error in wskerrors package
+ return nil, errors.New(wski18n.T(wski18n.ID_ERR_DEPENDENCY_UNKNOWN_TYPE))
}
keyValArrParams := make(whisk.KeyValueArr, 0)
@@ -245,15 +243,15 @@ func (dm *YAMLParser) ComposePackage(pkg Package, packageName string, filePath s
// TODO(#673) implement STRICT flag
if pkg.Version == "" {
warningString := wski18n.T(
- wski18n.ID_WARN_MISSING_MANDATORY_KEY_X_key_X_value_X,
+ wski18n.ID_WARN_KEY_MISSING_X_key_X_value_X,
map[string]interface{}{
- wski18n.KEY_KEY: PACKAGE_VERSION,
+ wski18n.KEY_KEY: wski18n.PACKAGE_VERSION,
wski18n.KEY_VALUE: DEFAULT_PACKAGE_VERSION})
wskprint.PrintOpenWhiskWarning(warningString)
warningString = wski18n.T(
wski18n.ID_WARN_KEYVALUE_NOT_SAVED_X_key_X,
- map[string]interface{}{wski18n.KEY_KEY: PACKAGE_VERSION})
+ map[string]interface{}{wski18n.KEY_KEY: wski18n.PACKAGE_VERSION})
wskprint.PrintOpenWhiskWarning(warningString)
pkg.Version = DEFAULT_PACKAGE_VERSION
@@ -265,15 +263,15 @@ func (dm *YAMLParser) ComposePackage(pkg Package, packageName string, filePath s
// TODO(#673) implement STRICT flag
if pkg.License == "" {
warningString := wski18n.T(
- wski18n.ID_WARN_MISSING_MANDATORY_KEY_X_key_X_value_X,
+ wski18n.ID_WARN_KEY_MISSING_X_key_X_value_X,
map[string]interface{}{
- wski18n.KEY_KEY: PACKAGE_LICENSE,
+ wski18n.KEY_KEY: wski18n.PACKAGE_LICENSE,
wski18n.KEY_VALUE: DEFAULT_PACKAGE_LICENSE})
wskprint.PrintOpenWhiskWarning(warningString)
warningString = wski18n.T(
wski18n.ID_WARN_KEYVALUE_NOT_SAVED_X_key_X,
- map[string]interface{}{wski18n.KEY_KEY: PACKAGE_VERSION})
+ map[string]interface{}{wski18n.KEY_KEY: wski18n.PACKAGE_VERSION})
wskprint.PrintOpenWhiskWarning(warningString)
@@ -423,8 +421,6 @@ func (dm *YAMLParser) ComposeActionsFromAllPackages(manifest *YAML, filePath str
func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action, packageName string, ma whisk.KeyValue) ([]utils.ActionRecord, error) {
- // TODO() i18n
- const RUNTIME_ERR_MESSAGE = "Please specify any of the supported runtime for zip actions in manifest YAML."
var errorParser error
var ext string
var s1 []utils.ActionRecord = make([]utils.ActionRecord, 0)
@@ -482,9 +478,15 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
// and its not explicitly specified in the manifest YAML file
// and action source is not a zip file
if len(kind) == 0 && len(action.Runtime) == 0 && ext != utils.ZIP_FILE_EXTENSION {
- // TODO() i18n
- errMessage := "ERROR: Failed to discover runtime from the action source files. " + RUNTIME_ERR_MESSAGE
- return nil, wskderrors.NewInvalidRuntimeError(errMessage, splitFilePath[len(splitFilePath)-1], action.Name, "Not Specified in Manifest YAML", utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
+ errMessage := wski18n.T(wski18n.ID_ERR_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: action.Runtime,
+ wski18n.KEY_EXTENTION: ext,
+ wski18n.KEY_ACTION: action.Name})
+ return nil, wskderrors.NewInvalidRuntimeError(errMessage,
+ splitFilePath[len(splitFilePath)-1], action.Name,
+ action.Runtime,
+ utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
}
wskaction.Exec.Kind = kind
@@ -499,9 +501,15 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
code = base64.StdEncoding.EncodeToString([]byte(dat))
}
if ext == utils.ZIP_FILE_EXTENSION && len(action.Runtime) == 0 {
- // TODO() i18n
- errMessage := "ERROR: Runtime is missing for zip action. " + RUNTIME_ERR_MESSAGE
- return nil, wskderrors.NewInvalidRuntimeError(errMessage, splitFilePath[len(splitFilePath)-1], action.Name, "Not Specified in Manifest YAML", utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
+ errMessage := wski18n.T(wski18n.ID_ERR_RUNTIME_INVALID_X_runtime_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: action.Runtime,
+ wski18n.KEY_ACTION: action.Name})
+ return nil, wskderrors.NewInvalidRuntimeError(errMessage,
+ splitFilePath[len(splitFilePath)-1],
+ action.Name,
+ action.Runtime,
+ utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
}
wskaction.Exec.Code = &code
}
@@ -525,33 +533,46 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
if utils.CheckRuntimeConsistencyWithFileExtension(ext, action.Runtime) {
wskaction.Exec.Kind = action.Runtime
} else {
- errStr := wski18n.T(wski18n.ID_MSG_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X,
- map[string]interface{}{"runtime": action.Runtime, "ext": ext, "action": action.Name})
- wskprint.PrintOpenWhiskWarning(errStr)
+ warnStr := wski18n.T(wski18n.ID_ERR_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: action.Runtime,
+ wski18n.KEY_EXTENTION: ext,
+ wski18n.KEY_ACTION: action.Name})
+ wskprint.PrintOpenWhiskWarning(warnStr)
// even if runtime is not consistent with file extension, deploy action with specified runtime in strict mode
if utils.Flags.Strict {
wskaction.Exec.Kind = action.Runtime
} else {
- errStr := wski18n.T(wski18n.ID_MSG_RUNTIME_CHANGED_X_runtime_X_action_X,
- map[string]interface{}{"runtime": wskaction.Exec.Kind, "action": action.Name})
- wskprint.PrintOpenWhiskWarning(errStr)
+ warnStr := wski18n.T(wski18n.ID_WARN_RUNTIME_CHANGED_X_runtime_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: wskaction.Exec.Kind,
+ wski18n.KEY_ACTION: action.Name})
+ wskprint.PrintOpenWhiskWarning(warnStr)
}
}
}
} else {
- errStr := wski18n.T(wski18n.ID_MSG_RUNTIME_UNSUPPORTED_X_runtime_X_action_X,
- map[string]interface{}{"runtime": action.Runtime, "action": action.Name})
- whisk.Debug(whisk.DbgWarn, errStr)
+ warnStr := wski18n.T(wski18n.ID_ERR_RUNTIME_INVALID_X_runtime_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: action.Runtime,
+ wski18n.KEY_ACTION: action.Name})
+ wskprint.PrintOpenWhiskWarning(warnStr)
+
if ext == utils.ZIP_FILE_EXTENSION {
- // TODO() i18n
- // for zip action, error out if specified runtime is not supported by OpenWhisk server
- errMessage := "ERROR: Given runtime for a zip action is not supported by OpenWhisk server. " + RUNTIME_ERR_MESSAGE
- return nil, wskderrors.NewInvalidRuntimeError(errMessage, splitFilePath[len(splitFilePath)-1], action.Name, action.Runtime, utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
+ // for zip action, error out if specified runtime is not supported by
+ // OpenWhisk server
+ return nil, wskderrors.NewInvalidRuntimeError(warnStr,
+ splitFilePath[len(splitFilePath)-1],
+ action.Name,
+ action.Runtime,
+ utils.ListOfSupportedRuntimes(utils.SupportedRunTimes))
} else {
- errStr = wski18n.T(wski18n.ID_MSG_RUNTIME_CHANGED_X_runtime_X_action_X,
- map[string]interface{}{"runtime": wskaction.Exec.Kind, "action": action.Name})
- whisk.Debug(whisk.DbgWarn, errStr)
+ warnStr := wski18n.T(wski18n.ID_WARN_RUNTIME_CHANGED_X_runtime_X_action_X,
+ map[string]interface{}{
+ wski18n.KEY_RUNTIME: wskaction.Exec.Kind,
+ wski18n.KEY_ACTION: action.Name})
+ wskprint.PrintOpenWhiskWarning(warnStr)
}
}
@@ -650,21 +671,21 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
if utils.LimitsTimeoutValidation(action.Limits.Timeout) {
wsklimits.Timeout = action.Limits.Timeout
} else {
- warningString := wski18n.T(wski18n.ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X,
+ warningString := wski18n.T(wski18n.ID_WARN_LIMIT_IGNORED_X_limit_X,
map[string]interface{}{wski18n.KEY_LIMIT: LIMIT_VALUE_TIMEOUT})
wskprint.PrintOpenWhiskWarning(warningString)
}
if utils.LimitsMemoryValidation(action.Limits.Memory) {
wsklimits.Memory = action.Limits.Memory
} else {
- warningString := wski18n.T(wski18n.ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X,
+ warningString := wski18n.T(wski18n.ID_WARN_LIMIT_IGNORED_X_limit_X,
map[string]interface{}{wski18n.KEY_LIMIT: LIMIT_VALUE_MEMORY_SIZE})
wskprint.PrintOpenWhiskWarning(warningString)
}
if utils.LimitsLogsizeValidation(action.Limits.Logsize) {
wsklimits.Logsize = action.Limits.Logsize
} else {
- warningString := wski18n.T(wski18n.ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X,
+ warningString := wski18n.T(wski18n.ID_WARN_LIMIT_IGNORED_X_limit_X,
map[string]interface{}{wski18n.KEY_LIMIT: LIMIT_VALUE_LOG_SIZE})
wskprint.PrintOpenWhiskWarning(warningString)
}
@@ -729,13 +750,12 @@ func (dm *YAMLParser) ComposeTriggers(filePath string, pkg Package, ma whisk.Key
// print warning information when .Source key's value is not empty
if trigger.Source != "" {
- // TODO() i18n use const for keys and values on string
warningString := wski18n.T(
- wski18n.ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
+ wski18n.ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
map[string]interface{}{
- wski18n.KEY_OLD: "source",
+ wski18n.KEY_OLD: YAML_KEY_SOURCE,
wski18n.KEY_NEW: YAML_KEY_FEED,
- wski18n.KEY_FILE_TYPE: "manifest"})
+ wski18n.KEY_FILE_TYPE: wski18n.MANIFEST})
wskprint.PrintOpenWhiskWarning(warningString)
}
if trigger.Feed == "" {
diff --git a/parsers/yamlparser.go b/parsers/yamlparser.go
index fd7a24c0..6bcee666 100644
--- a/parsers/yamlparser.go
+++ b/parsers/yamlparser.go
@@ -23,25 +23,21 @@ import (
)
// YAML schema key names
+// DO NOT translate
const(
- YAML_KEY_PROJECT = "project"
- YAML_KEY_APPLICATION = "application" // deprecated
- YAML_KEY_PACKAGE = "package"
YAML_KEY_ACTION = "action"
- YAML_KEY_TRIGGER = "trigger"
- YAML_KEY_RULE = "rule"
- YAML_KEY_FEED = "feed"
+ YAML_KEY_ANNOTATION = "annotoation"
YAML_KEY_API = "api"
+ YAML_KEY_FEED = "feed"
+ YAML_KEY_NAMESPACE = "namespace"
+ YAML_KEY_PACKAGES = "packages"
+ YAML_KEY_PROJECT = "project"
+ YAML_KEY_RULE = "rule"
YAML_KEY_SEQUENCE = "sequence"
-)
-
-// descriptive key names
-const (
- PROJECT_NAME = "project name"
- PACKAGE_BINDING = "package binding"
- PACKAGE_VERSION = "package version"
- PACKAGE_LICENSE = "package license"
- TRIGGER_FEED = "trigger feed"
+ YAML_KEY_TRIGGER = "trigger"
+ YAML_KEY_APPLICATION = "application" // deprecated
+ YAML_KEY_PACKAGE = "package" // deprecated
+ YAML_KEY_SOURCE = "source" // deprecated
)
// YAML schema key values
@@ -165,7 +161,7 @@ type Feed struct {
Inputs map[string]string `yaml:"inputs"` //used in deployment.yaml
Location string `yaml:"location"` //used in manifest.yaml
Action string `yaml:"action"` //used in manifest.yaml
- //TODO: need to define operation structure
+ // TODO(): need to define operation structure
Operations map[string]interface{} `yaml:"operations"` //used in manifest.yaml
Name string
}
diff --git a/utils/flags.go b/utils/flags.go
index 2a31256b..6cbc0d9e 100644
--- a/utils/flags.go
+++ b/utils/flags.go
@@ -17,7 +17,12 @@
package utils
-var Flags struct {
+import (
+ "fmt"
+ "reflect"
+)
+
+type WskDeployFlags struct {
WithinOpenWhisk bool // is this running within an OpenWhisk action?
ApiHost string // OpenWhisk API host
Auth string // OpenWhisk API key
@@ -36,20 +41,28 @@ var Flags struct {
Key string
Cert string
Managed bool // OpenWhisk Managed Deployments
+}
+
+func (flags *WskDeployFlags) Format() string {
+
+ flagNames := reflect.TypeOf(*flags)
+ flagValues := reflect.ValueOf(*flags)
- //action flag definition
- //from go cli
- action struct {
- docker bool
- copy bool
- pipe bool
- web string
- sequence bool
- timeout int
- memory int
- logsize int
- result bool
- kind string
- main string
+ var name string
+ var value interface{}
+ //var t interface{}
+ var result string
+
+ for i := 0; i < flagValues.NumField(); i++ {
+ name = flagNames.Field(i).Name
+ value = flagValues.Field(i)
+ // NOTE: if you need to see the Type, add this line to output
+ //t = flagValues.Field(i).Type()
+ line := fmt.Sprintf(" > %s: [%v]\n", name, value)
+ result += line
}
+
+ return result
}
+
+var Flags WskDeployFlags
diff --git a/utils/runtimes.go b/utils/runtimes.go
index bacc54dc..ed22fa0d 100644
--- a/utils/runtimes.go
+++ b/utils/runtimes.go
@@ -94,7 +94,7 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
res, err := netClient.Do(req)
if err != nil {
// TODO() create an error
- errString := wski18n.T(wski18n.ID_ERR_GET_RUNTIMES_X_err_X,
+ errString := wski18n.T(wski18n.ID_ERR_RUNTIMES_GET_X_err_X,
map[string]interface{}{"err": err.Error()})
whisk.Debug(whisk.DbgWarn, errString)
}
diff --git a/utils/validation.go b/utils/validation.go
index 9e17088c..2f926af0 100644
--- a/utils/validation.go
+++ b/utils/validation.go
@@ -109,6 +109,7 @@ func LicenseRemoteValidation(license string) bool {
if len(license_json.Licenses) == 0 {
json_data, err := Read(RemoteLicenseURL)
if err != nil {
+ // TODO() i18n
errString := wski18n.T("Failed to get the remote license json.\n")
whisk.Debug(whisk.DbgError, errString)
return false
@@ -117,6 +118,7 @@ func LicenseRemoteValidation(license string) bool {
//parse json
err = json.Unmarshal(json_data, &license_json)
if err != nil || len(license_json.Licenses) == 0 {
+ // TODO() i18n
errString := wski18n.T("Failed to parse the remote license json.\n")
whisk.Debug(whisk.DbgError, errString)
return false
diff --git a/wski18n/i18n_ids.go b/wski18n/i18n_ids.go
index af599fae..8f8b544e 100644
--- a/wski18n/i18n_ids.go
+++ b/wski18n/i18n_ids.go
@@ -17,29 +17,81 @@
package wski18n
+// descriptive key names
+// DO NOT TRANSLATE
+const (
+ ACTION_CODE = "Action source"
+ ACTIONS = "Actions"
+ ACTIVATIONS = "Activations"
+ API_HOST = "API host"
+ AUTH_KEY = "authentication key"
+ COMMAND_LINE = "wskdeploy command line"
+ DEPLOYMENT = "deployment"
+ CONFIGURATION = "Configuration"
+ MANIFEST = "manifest"
+ NAME_ACTION = "Action Name"
+ NAME_FEED = "Feed Name"
+ NAME_RULE = "Rule Name"
+ NAME_RUNTIME = "Runtime Name"
+ NAME_TRIGGER = "Trigger Name"
+ NAMESPACES = "Namespaces"
+ PACKAGE_BINDING = "package binding"
+ PACKAGE_LICENSE = "package license"
+ PACKAGE_NAME = "package name"
+ PACKAGE_VERSION = "package version"
+ PACKAGES = "Packages"
+ PROJECT_NAME = "project name"
+ REGISTRY = "registry"
+ REGISTRY_URL = "registry URL"
+ REPOSITORY = "repository"
+ RULES = "Rules"
+ TRIGGER_FEED = "trigger feed"
+ TRIGGERS = "Triggers"
+ WHISK_PROPS = "wskprops"
+)
+
+// i18n Identifiers
+// DO NOT TRANSLATE
const(
// Debug / trace message prefixes
ID_MSG_PREFIX_ERROR = "msg_prefix_error" // "Error"
+ ID_MSG_PREFIX_INFO = "msg_prefix_info" // "Info"
ID_MSG_PREFIX_SUCCESS = "msg_prefix_success" // "Success"
ID_MSG_PREFIX_WARNING = "msg_prefix_warning" // "Warning"
- ID_MSG_PREFIX_INFO = "msg_prefix_info" // "Info"
- // wskdeploy (as an Action) JSON messages
- ID_JSON_MISSING_KEY_CMD = "msg_json_missing_cmd_key" // "Missing 'cmd' input key"
+ // Cobra command descriptions
+ ID_CMD_DESC_LONG_PUBLISH = "msg_cmd_desc_long_publish"
+ ID_CMD_DESC_LONG_REPORT = "msg_cmd_desc_long_report"
+ ID_CMD_DESC_LONG_ROOT = "msg_cmd_desc_long_root"
+ ID_CMD_DESC_SHORT_ADD = "msg_cmd_desc_short_add"
+ ID_CMD_DESC_SHORT_ADD_X_key_X = "msg_cmd_desc_short_add_entity"
+ ID_CMD_DESC_SHORT_PUBLISH = "msg_cmd_desc_short_publish"
+ ID_CMD_DESC_SHORT_REPORT = "msg_cmd_desc_short_report"
+ ID_CMD_DESC_SHORT_ROOT = "msg_cmd_desc_short_root"
+ ID_CMD_DESC_SHORT_VERSION = "msg_cmd_desc_short_version"
- // wskdeploy Command messages
- ID_CMD_FLAG_AUTH_KEY = "msg_cmd_flag_auth_key" // "authorization `KEY`"
- ID_CMD_FLAG_NAMESPACE = "msg_cmd_flag_namespace" // "namespace"
- ID_CMD_FLAG_API_HOST = "msg_cmd_flag_api_host" // "whisk API `HOST`"
- ID_CMD_FLAG_API_VERSION = "msg_cmd_flag_api_version" // "whisk API `VERSION`"
- ID_CMD_FLAG_KEY_FILE = "msg_cmd_flag_key_file" // "path of the .key file"
- ID_CMD_FLAG_CERT_FILE = "msg_cmd_flag_cert_file" // "path of the .cert file"
+ // Cobra Flag messages
+ ID_CMD_FLAG_API_HOST = "msg_cmd_flag_api_host"
+ ID_CMD_FLAG_API_VERSION = "msg_cmd_flag_api_version"
+ ID_CMD_FLAG_AUTH_KEY = "msg_cmd_flag_auth_key"
+ ID_CMD_FLAG_CERT_FILE = "msg_cmd_flag_cert_file"
+ ID_CMD_FLAG_CONFIG = "msg_cmd_flag_config"
+ ID_CMD_FLAG_DEFAULTS = "msg_cmd_flag_allow_defaults"
+ ID_CMD_FLAG_DEPLOYMENT = "msg_cmd_flag_deployment"
+ ID_CMD_FLAG_INTERACTIVE = "msg_cmd_flag_interactive"
+ ID_CMD_FLAG_KEY_FILE = "msg_cmd_flag_key_file"
+ ID_CMD_FLAG_MANAGED = "msg_cmd_flag_allow_managed"
+ ID_CMD_FLAG_MANIFEST = "msg_cmd_flag_manifest"
+ ID_CMD_FLAG_NAMESPACE = "msg_cmd_flag_namespace"
+ ID_CMD_FLAG_PROJECT = "msg_cmd_flag_project"
+ ID_CMD_FLAG_STRICT = "msg_cmd_flag_strict"
+ ID_CMD_FLAG_TOGGLE_HELP = "msg_cmd_flag_toggle_help"
+ ID_CMD_FLAG_VERBOSE = "msg_cmd_flag_allow_verbose"
// Configuration messages
ID_MSG_CONFIG_MISSING_AUTHKEY = "msg_config_missing_authkey"
ID_MSG_CONFIG_MISSING_APIHOST = "msg_config_missing_apihost"
ID_MSG_CONFIG_MISSING_NAMESPACE = "msg_config_missing_namespace"
-
ID_MSG_CONFIG_INFO_APIHOST_X_host_X_source_X = "msg_config_apihost_info"
ID_MSG_CONFIG_INFO_AUTHKEY_X_source_X = "msg_config_authkey_info"
ID_MSG_CONFIG_INFO_NAMESPACE_X_namespace_X_source_X = "msg_config_namespace_info"
@@ -49,155 +101,208 @@ const(
ID_MSG_UNMARSHAL_NETWORK = "msg_unmarshall_network"
// Informational
- ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X = "msg_manifest_not_found"
- ID_MSG_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X = "msg_runtime_mismatch"
- ID_MSG_RUNTIME_CHANGED_X_runtime_X_action_X = "msg_runtime_changed"
- ID_MSG_RUNTIME_UNSUPPORTED_X_runtime_X_action_X = "msg_runtime_unsupported"
+ ID_MSG_DEPLOYMENT_CANCELLED = "msg_deployment_cancelled"
+ ID_MSG_DEPLOYMENT_FAILED = "msg_deployment_failed"
+ ID_MSG_DEPLOYMENT_REPORT = "msg_deployment_report_status"
+ ID_MSG_DEPLOYMENT_SUCCEEDED = "msg_deployment_succeeded"
- ID_MSG_MANIFEST_DEPLOY_X_path_X = "msg_using_manifest_deploy" // "Using {{.path}} for deployment.\n"
- ID_MSG_MANIFEST_UNDEPLOY_X_path_X = "msg_using_manifest_undeploy" // "Using {{.path}} for undeployment.\n"
+ ID_MSG_UNDEPLOYMENT_CANCELLED = "msg_undeployment_cancelled"
+ ID_MSG_UNDEPLOYMENT_FAILED = "msg_undeployment_failed"
+ ID_MSG_UNDEPLOYMENT_SUCCEEDED = "msg_undeployment_succeeded"
- ID_MSG_DEPLOYMENT_SUCCEEDED = "msg_deployment_succeeded"
- ID_MSG_DEPLOYMENT_FAILED = "msg_deployment_failed"
- ID_MSG_DEPLOYMENT_CANCELLED = "msg_deployment_cancelled"
+ ID_MSG_MANIFEST_DEPLOY_X_path_X = "msg_manifest_using_deployment"
+ ID_MSG_MANIFEST_UNDEPLOY_X_path_X = "msg_manifest_using_undeployment"
- ID_MSG_ENTITY_DEPLOYING_X_key_X_name_X = "msg_entity_deploying"
- ID_MSG_ENTITY_UNDEPLOYING_X_key_X_name_X = "msg_entity_undeploying"
ID_MSG_ENTITY_DEPLOYED_SUCCESS_X_key_X_name_X = "msg_entity_deployed_success"
+ ID_MSG_ENTITY_DEPLOYING_X_key_X_name_X = "msg_entity_deploying"
ID_MSG_ENTITY_UNDEPLOYED_SUCCESS_X_key_X_name_X = "msg_entity_undeployed_success"
+ ID_MSG_ENTITY_UNDEPLOYING_X_key_X_name_X = "msg_entity_undeploying"
- ID_MSG_UNDEPLOYMENT_SUCCEEDED = "msg_undeployment_succeeded"
- ID_MSG_UNDEPLOYMENT_FAILED = "msg_undeployment_failed"
- ID_MSG_UNDEPLOYMENT_CANCELLED = "msg_undeployment_cancelled"
-
- ID_MSG_DEPENDENCY_DEPLOYING_X_name_X = "msg_deploying_dependency"
- ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X = "msg_undeploying_dependency"
- ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X = "msg_dependency_deployment_success"
+ ID_MSG_DEPENDENCY_DEPLOYING_X_name_X = "msg_dependency_deploying"
ID_MSG_DEPENDENCY_DEPLOYMENT_FAILURE_X_name_X = "msg_dependency_deployment_failure"
- ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X = "msg_dependency_undeployment_success"
+ ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X = "msg_dependency_deployment_success"
+ ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X = "msg_dependency_undeploying"
ID_MSG_DEPENDENCY_UNDEPLOYMENT_FAILURE_X_name_X = "msg_dependency_undeployment_failure"
+ ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X = "msg_dependency_undeployment_success"
// Managed deployments
- ID_MSG_MANAGED_UNDEPLOYMENT_FAILED = "msg_undeployment_managed_failed"
+ ID_MSG_MANAGED_UNDEPLOYMENT_FAILED = "msg_managed_undeployment_failed"
ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X = "msg_managed_found_deleted_entity"
// Interactive (prompts)
- ID_MSG_PROMPT_DEPLOY = "msg_prompt_deploy"
- ID_MSG_PROMPT_UNDEPLOY = "msg_prompt_undeploy"
- ID_MSG_PROMPT_AUTHKEY = "msg_prompt_authkey"
ID_MSG_PROMPT_APIHOST = "msg_prompt_apihost"
+ ID_MSG_PROMPT_AUTHKEY = "msg_prompt_authkey"
+ ID_MSG_PROMPT_DEPLOY = "msg_prompt_deploy"
ID_MSG_PROMPT_NAMESPACE = "msg_prompt_namespace"
+ ID_MSG_PROMPT_UNDEPLOY = "msg_prompt_undeploy"
- // Action Limits
- ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X = "msg_action_limit_ignored" // timeout, memorySize, logSize
+ // Errors
+ ID_ERR_DEPENDENCY_UNKNOWN_TYPE = "msg_err_dependency_unknown_type"
+ ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X = "msg_err_deployment_name_not_found"
+ ID_ERR_ENTITY_CREATE_X_key_X_err_X_code_X = "msg_err_entity_create"
+ ID_ERR_ENTITY_DELETE_X_key_X_err_X_code_X = "msg_err_entity_delete"
+ ID_ERR_FEED_INVOKE_X_err_X_code_X = "msg_err_feed_invoke"
+ ID_ERR_KEY_MISSING_X_key_X = "msg_err_key_missing_mandatory"
+ ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X = "msg_err_manifest_not_found"
+ ID_ERR_NAME_MISMATCH_X_key_X_dname_X_dpath_X_mname_X_moath_X = "msg_err_name_mismatch"
+ ID_ERR_RUNTIME_INVALID_X_runtime_X_action_X = "msg_err_runtime_invalid"
+ ID_ERR_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X = "msg_err_runtime_mismatch"
+ ID_ERR_RUNTIMES_GET_X_err_X = "msg_err_runtimes_get"
+ ID_ERR_URL_INVALID_X_urltype_X_url_X_filetype_X = "msg_err_url_invalid"
+ ID_ERR_URL_MALFORMED_X_urltype_X_url_X = "msg_err_url_malformed"
+
+ // Server-side Errors (wskdeploy as an Action)
+ ID_ERR_JSON_MISSING_KEY_CMD = "msg_err_json_missing_cmd_key"
// warnings
- ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X = "msg_warn_key_deprecated_replaced"
- ID_WARN_WHISK_PROPS_DEPRECATED = "msg_warn_whisk_properties"
- ID_WARN_MISSING_MANDATORY_KEY_X_key_X_value_X = "msg_warn_missing_mandatory_key"
+ ID_WARN_COMMAND_RETRY = "msg_warn_command_retry"
+ ID_WARN_CONFIG_INVALID_X_path_X = "msg_warn_config_invalid"
+ ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X = "msg_warn_key_deprecated_replaced"
+ ID_WARN_KEY_MISSING_X_key_X_value_X = "msg_warn_key_missing"
+ ID_WARN_KEYVALUE_INVALID = "msg_warn_key_value_invalid"
ID_WARN_KEYVALUE_NOT_SAVED_X_key_X = "msg_warn_key_value_not_saved"
- ID_WARN_KEYVALUE_INVALID = "msg_warn_invalid_key_value"
- ID_WARN_LIMITS_TIMEOUT = "msg_warn_limits_timeout"
- ID_WARN_LIMITS_MEMORY_SIZE = "msg_warn_limits_memory_size"
- ID_WARN_LIMITS_LOG_SIZE = "msg_warn_limits_memory_log_size"
+ ID_WARN_LIMIT_IGNORED_X_limit_X = "msg_warn_limit_ignored"
ID_WARN_LIMIT_UNCHANGEABLE_X_name_X = "msg_warn_limit_changeable"
+ ID_WARN_LIMITS_LOG_SIZE = "msg_warn_limits_log_size" // TODO() remove for value range
+ ID_WARN_LIMITS_MEMORY_SIZE = "msg_warn_limits_memory_size" // TODO() remove for value range
+ ID_WARN_LIMITS_TIMEOUT = "msg_warn_limits_timeout" // TODO() remove for value range
+ ID_WARN_RUNTIME_CHANGED_X_runtime_X_action_X = "msg_warn_runtime_changed"
+ ID_WARN_VALUE_RANGE_X_name_X_key_X_filetype_X_min_X_max_X = "msg_warn_value_range" // TODO() not used, but should be used for limit ranges
+ ID_WARN_WHISK_PROPS_DEPRECATED = "msg_warn_whisk_properties"
+ ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X = "msg_warn_entity_name_exists"
- // Errors
- ID_ERR_GET_RUNTIMES_X_err_X = "msg_err_get_runtimes"
- ID_ERR_MISSING_MANDATORY_KEY_X_key_X = "msg_err_missing_mandatory_key"
- ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X = "msg_err_mismatch_name_project"
- ID_ERR_CREATE_ENTITY_X_key_X_err_X_code_X = "msg_err_create_entity"
- ID_ERR_DELETE_ENTITY_X_key_X_err_X_code_X = "msg_err_delete_entity"
- ID_ERR_FEED_INVOKE_X_err_X_code_X = "msg_err_feed_invoke"
+ // Verbose (Debug/Trace) messages
+ ID_DEBUG_KEY_VERIFY_X_name_X_key_X = "msg_dbg_key_verify"
+ ID_DEBUG_DEPLOYING_USING = "msg_dbg_deploying_using"
+ ID_DEBUG_UNDEPLOYING_USING = "msg_dbg_undeploying_using"
+ ID_DEBUG_PROJECT_SEARCH_X_path_X_key_X = "msg_dbg_searching_project_directory"
)
// Known keys used for text replacement in i18n translated strings
const(
- KEY_KEY = "key"
- KEY_VALUE = "value"
- KEY_NAME = "name"
- KEY_CODE = "code"
- KEY_ERR = "err"
- KEY_PROJECT = "project"
KEY_ACTION = "action"
- KEY_LIMIT = "limit"
- KEY_HOST = "host"
- KEY_SOURCE = "source"
- KEY_NAMESPACE = "namespace"
- KEY_PATH = "path"
- KEY_EXTENTION = "ext"
- KEY_RUNTIME = "runtime"
+ KEY_CMD = "cmd"
+ KEY_CODE = "code"
KEY_DEPLOYMENT_NAME = "dname"
KEY_DEPLOYMENT_PATH = "dpath"
+ KEY_ERR = "err"
+ KEY_EXTENTION = "ext"
+ KEY_FILE_TYPE = "filetype"
+ KEY_HOST = "host"
+ KEY_KEY = "key"
+ KEY_LIMIT = "limit"
KEY_MANIFEST_NAME = "mname"
KEY_MANIFEST_PATH = "mpath"
- KEY_OLD = "oldkey"
+ KEY_NAME = "name"
+ KEY_NAMESPACE = "namespace"
KEY_NEW = "newkey"
- KEY_FILE_TYPE = "filetype"
+ KEY_OLD = "oldkey"
+ KEY_PATH = "path"
+ KEY_PROJECT = "project"
+ KEY_RUNTIME = "runtime"
+ KEY_SOURCE = "source"
+ KEY_URL = "url"
+ KEY_URL_TYPE = "urltype"
+ KEY_VALUE = "value"
+ KEY_VALUE_MIN = "min" // TODO() attempt to use this for Limit value range errors
+ KEY_VALUE_MAX = "max" // TODO() attempt to use this for Limit value range errors
)
+// Used to unit test that translations exist with these IDs
var I18N_ID_SET = [](string){
- ID_MSG_PREFIX_ERROR,
- ID_MSG_PREFIX_SUCCESS,
- ID_MSG_PREFIX_WARNING,
- ID_MSG_PREFIX_INFO,
- ID_JSON_MISSING_KEY_CMD,
- ID_CMD_FLAG_AUTH_KEY,
- ID_CMD_FLAG_NAMESPACE,
+ ID_CMD_DESC_LONG_PUBLISH,
+ ID_CMD_DESC_LONG_REPORT,
+ ID_CMD_DESC_LONG_ROOT,
+ ID_CMD_DESC_SHORT_ADD,
+ ID_CMD_DESC_SHORT_ADD_X_key_X,
+ ID_CMD_DESC_SHORT_PUBLISH,
+ ID_CMD_DESC_SHORT_REPORT,
+ ID_CMD_DESC_SHORT_ROOT,
+ ID_CMD_DESC_SHORT_VERSION,
ID_CMD_FLAG_API_HOST,
ID_CMD_FLAG_API_VERSION,
- ID_CMD_FLAG_KEY_FILE,
+ ID_CMD_FLAG_AUTH_KEY,
ID_CMD_FLAG_CERT_FILE,
- ID_MSG_CONFIG_MISSING_AUTHKEY,
- ID_MSG_CONFIG_MISSING_APIHOST,
- ID_MSG_CONFIG_MISSING_NAMESPACE,
+ ID_CMD_FLAG_CONFIG,
+ ID_CMD_FLAG_DEFAULTS,
+ ID_CMD_FLAG_DEPLOYMENT,
+ ID_CMD_FLAG_INTERACTIVE,
+ ID_CMD_FLAG_KEY_FILE,
+ ID_CMD_FLAG_MANAGED,
+ ID_CMD_FLAG_MANIFEST,
+ ID_CMD_FLAG_NAMESPACE,
+ ID_CMD_FLAG_PROJECT,
+ ID_CMD_FLAG_STRICT,
+ ID_CMD_FLAG_TOGGLE_HELP,
+ ID_CMD_FLAG_VERBOSE,
+ ID_DEBUG_DEPLOYING_USING,
+ ID_DEBUG_KEY_VERIFY_X_name_X_key_X,
+ ID_DEBUG_PROJECT_SEARCH_X_path_X_key_X,
+ ID_DEBUG_UNDEPLOYING_USING,
+ ID_ERR_DEPENDENCY_UNKNOWN_TYPE,
+ ID_ERR_DEPLOYMENT_NAME_NOT_FOUND_X_key_X_name_X,
+ ID_ERR_ENTITY_CREATE_X_key_X_err_X_code_X,
+ ID_ERR_ENTITY_DELETE_X_key_X_err_X_code_X,
+ ID_ERR_JSON_MISSING_KEY_CMD,
+ ID_ERR_JSON_MISSING_KEY_CMD,
+ ID_ERR_KEY_MISSING_X_key_X,
+ ID_ERR_MANIFEST_FILE_NOT_FOUND_X_path_X,
+ ID_ERR_NAME_MISMATCH_X_key_X_dname_X_dpath_X_mname_X_moath_X,
+ ID_ERR_RUNTIME_INVALID_X_runtime_X_action_X,
+ ID_ERR_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X,
+ ID_ERR_RUNTIMES_GET_X_err_X,
+ ID_ERR_URL_INVALID_X_urltype_X_url_X_filetype_X,
+ ID_ERR_URL_MALFORMED_X_urltype_X_url_X,
ID_MSG_CONFIG_INFO_APIHOST_X_host_X_source_X,
ID_MSG_CONFIG_INFO_AUTHKEY_X_source_X,
ID_MSG_CONFIG_INFO_NAMESPACE_X_namespace_X_source_X,
- ID_MSG_UNMARSHAL_LOCAL,
- ID_MSG_UNMARSHAL_NETWORK,
- ID_MSG_MANIFEST_FILE_NOT_FOUND_X_path_X,
- ID_MSG_RUNTIME_MISMATCH_X_runtime_X_ext_X_action_X,
- ID_MSG_RUNTIME_CHANGED_X_runtime_X_action_X,
- ID_MSG_RUNTIME_UNSUPPORTED_X_runtime_X_action_X,
- ID_MSG_MANIFEST_DEPLOY_X_path_X,
- ID_MSG_MANIFEST_UNDEPLOY_X_path_X,
- ID_MSG_DEPLOYMENT_SUCCEEDED,
- ID_MSG_DEPLOYMENT_FAILED,
- ID_MSG_DEPLOYMENT_CANCELLED,
- ID_MSG_ENTITY_DEPLOYING_X_key_X_name_X,
- ID_MSG_ENTITY_UNDEPLOYING_X_key_X_name_X,
- ID_MSG_ENTITY_DEPLOYED_SUCCESS_X_key_X_name_X,
- ID_MSG_ENTITY_UNDEPLOYED_SUCCESS_X_key_X_name_X,
- ID_MSG_UNDEPLOYMENT_SUCCEEDED,
- ID_MSG_UNDEPLOYMENT_FAILED,
- ID_MSG_UNDEPLOYMENT_CANCELLED,
+ ID_MSG_CONFIG_MISSING_APIHOST,
+ ID_MSG_CONFIG_MISSING_AUTHKEY,
+ ID_MSG_CONFIG_MISSING_NAMESPACE,
ID_MSG_DEPENDENCY_DEPLOYING_X_name_X,
- ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X,
- ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
ID_MSG_DEPENDENCY_DEPLOYMENT_FAILURE_X_name_X,
- ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X,
+ ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
+ ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X,
ID_MSG_DEPENDENCY_UNDEPLOYMENT_FAILURE_X_name_X,
- ID_MSG_MANAGED_UNDEPLOYMENT_FAILED,
+ ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X,
+ ID_MSG_DEPLOYMENT_CANCELLED,
+ ID_MSG_DEPLOYMENT_FAILED,
+ ID_MSG_DEPLOYMENT_REPORT,
+ ID_MSG_DEPLOYMENT_SUCCEEDED,
+ ID_MSG_ENTITY_DEPLOYED_SUCCESS_X_key_X_name_X,
+ ID_MSG_ENTITY_DEPLOYING_X_key_X_name_X,
+ ID_MSG_ENTITY_UNDEPLOYED_SUCCESS_X_key_X_name_X,
+ ID_MSG_ENTITY_UNDEPLOYING_X_key_X_name_X,
ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
- ID_MSG_PROMPT_DEPLOY,
- ID_MSG_PROMPT_UNDEPLOY,
- ID_MSG_PROMPT_AUTHKEY,
+ ID_MSG_MANAGED_UNDEPLOYMENT_FAILED,
+ ID_MSG_MANIFEST_DEPLOY_X_path_X,
+ ID_MSG_MANIFEST_UNDEPLOY_X_path_X,
+ ID_MSG_PREFIX_ERROR,
+ ID_MSG_PREFIX_INFO,
+ ID_MSG_PREFIX_SUCCESS,
+ ID_MSG_PREFIX_WARNING,
ID_MSG_PROMPT_APIHOST,
+ ID_MSG_PROMPT_AUTHKEY,
+ ID_MSG_PROMPT_DEPLOY,
ID_MSG_PROMPT_NAMESPACE,
- ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X,
- ID_WARN_DEPRECATED_KEY_REPLACED_X_oldkey_X_filetype_X_newkey_X,
- ID_WARN_WHISK_PROPS_DEPRECATED,
- ID_WARN_MISSING_MANDATORY_KEY_X_key_X_value_X,
- ID_WARN_KEYVALUE_NOT_SAVED_X_key_X,
+ ID_MSG_PROMPT_UNDEPLOY,
+ ID_MSG_UNDEPLOYMENT_CANCELLED,
+ ID_MSG_UNDEPLOYMENT_FAILED,
+ ID_MSG_UNDEPLOYMENT_SUCCEEDED,
+ ID_MSG_UNMARSHAL_LOCAL,
+ ID_MSG_UNMARSHAL_NETWORK,
+ ID_WARN_COMMAND_RETRY,
+ ID_WARN_CONFIG_INVALID_X_path_X,
+ ID_WARN_ENTITY_NAME_EXISTS_X_key_X_name_X,
+ ID_WARN_KEY_DEPRECATED_X_oldkey_X_filetype_X_newkey_X,
+ ID_WARN_KEY_MISSING_X_key_X_value_X,
ID_WARN_KEYVALUE_INVALID,
- ID_WARN_LIMITS_TIMEOUT,
- ID_WARN_LIMITS_MEMORY_SIZE,
- ID_WARN_LIMITS_LOG_SIZE,
+ ID_WARN_KEYVALUE_NOT_SAVED_X_key_X,
+ ID_WARN_LIMIT_IGNORED_X_limit_X,
ID_WARN_LIMIT_UNCHANGEABLE_X_name_X,
- ID_ERR_GET_RUNTIMES_X_err_X,
- ID_ERR_MISSING_MANDATORY_KEY_X_key_X,
- ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X,
- ID_ERR_CREATE_ENTITY_X_key_X_err_X_code_X,
- ID_ERR_DELETE_ENTITY_X_key_X_err_X_code_X,
+ ID_WARN_LIMITS_LOG_SIZE,
+ ID_WARN_LIMITS_MEMORY_SIZE,
+ ID_WARN_LIMITS_TIMEOUT,
+ ID_WARN_RUNTIME_CHANGED_X_runtime_X_action_X,
+ ID_WARN_WHISK_PROPS_DEPRECATED,
}
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index 1a041853..29d85282 100644
--- a/wski18n/i18n_resources.go
+++ b/wski18n/i18n_resources.go
@@ -97,7 +97,7 @@ func wski18nResourcesDe_deAllJson() (*asset, error) {
return a, nil
}
-var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x59\x51\x6f\xdb\x38\x12\x7e\xcf\xaf\x18\xe4\xa5\x77\x40\xe0\x6b\x7b\x38\xe0\xd0\x97\xc5\x62\xd3\xc5\x66\xbb\x6d\x8a\xa6\xdd\x62\xd1\x16\x0a\x23\x8e\x64\xd6\x14\x29\x90\x94\x5d\xd7\xf0\x7f\x5f\x0c\x29\x4a\x76\x12\x4a\xb2\x93\x62\xf3\xc4\x98\xc3\xf9\x66\x86\xc3\x99\x8f\xd4\xa7\x13\x80\xcd\x09\x00\xc0\xa9\xe0\xa7\x2f\xe0\xb4\xb2\x65\x56\x1b\x2c\xc4\xb7\x0c\x8d\xd1\xe6\xf4\x2c\xcc\x3a\xc3\x94\x95\xcc\x09\xad\x48\xec\xa5\x9f\x3b\x01\xd8\x9e\x0d\x68\x58\x31\xa3\x84\x2a\x13\x3a\x3e\xb6\xb3\x63\x5a\x6c\x93\xe7\x68\x6d\x42\xcb\x55\x3b\x3b\xa6\x45\xa8\x42\x27\x54\x5c\xd0\x54\x72\xfd\x57\xab\x55\x56\x09\x6b\x85\x2a\xb3\xbc\xe2\xd9\x02\xd7\x09\x45\xbf\x5f\x5d\xbe\x01\xa1\xea\xc6\x01\x67\x8e\xc1\xeb\xb0\x0a\x9e\xe4\x15\x7f\x02\xb4\x2e\x89\x42\x8a\x0b\xc9\xca\x4c\xb1\x0a\x6d\xcd\x72\x4c\x60\xf4\xf3\xe3\xba\x58\xe3\xe6\x03\xe6\xd2\xb4\x36\xe2\xbb\xff\x01\xae\x5f\xbd\xfc\xeb\x7a\x8a\xd2\x5a\x64\x73\x6d\x5d\x42\
xe9\x6a\x2e\xec\x02\x7e\x7e\x7b\x01\xd7\xbf\x5d\x5e\xbd\x9f\xaa\x71\x89\xc6\x92\x86\x51\xa5\x7f\xbe\x7c\x77\x75\x71\xf9\x66\x8a\xde\x05\xae\xb3\x42\xc8\x54\x24\x6b\xe6\xe6\xa0\x0b\x70\x73\x84\xd9\x02\xd7\xe0\x65\xc7\xd5\xe6\x68\xdc\x64\xbd\x24\x3c\xa2\xb8\x36\xba\xaa\x5d\xc6\xb1\x96\x3a\xb5\x55\xe7\x1a\xd6\xba\x01\x83\x4c\xca\x35\xac\x98\x72\xe0\x34\x84\x25\xe0\xe6\xc2\xfe\x04\xff\x5a\xff\xe7\xcd\xbf\x5f\xc0\x28\x4e\xa3\x8e\x40\x8a\x8b\x0e\xc4\xa2\x0c\x4b\xe7\xdf\x67\xf5\x56\x22\xb3\x08\xb5\xd1\x4b\xc1\x11\x98\x02\x5a\x81\xca\x89\x3c\x24\xa5\xd3\x0b\x54\x53\x80\x6a\x31\x90\x93\x77\x80\x68\x6b\x48\x9e\x0e\x13\x14\xda\xc0\x65\x8d\xea\x23\x25\xd9\x04\xac\xb1\x13\x7a\xd7\x2d\xe8\x96\xc0\x27\x8e\x05\x6b\xa4\x83\x25\x93\x0d\x82\xb0\x50\x36\x68\xdd\x97\x21\xdc\x8a\x29\x51\xa0\x75\x99\xd2\x2e\x2b\x74\xa3\x78\x02\xf9\x75\x2b\xe8\x13\x0e\x94\x76\xe0\xa5\x81\x39\xf0\x49\xf9\x69\xb3\x99\xd1\x60\xbb\xfd\x32\xfb\xac\xd2\x80\x8d\xaf\x75\x1d\xec\x60\xbe\x7c\xf0\x15\x6e\x47\xb3\x8f\x67\x58\x52\xa1\x
72\x87\x00\x8d\xa4\xe6\xfd\x50\x71\xd1\x28\x98\x69\x94\x13\x15\x52\x2d\xaf\x98\xcb\xe7\x09\x94\x77\x41\xcc\xe3\xb4\x4b\x08\xca\xd6\x98\x8b\x42\x20\x07\xa1\x20\x5a\x0c\x5c\xa3\xf5\x81\xf6\x1a\x61\x25\xdc\x1c\x58\xee\x53\xd7\xea\xc6\xe4\x18\xb6\x02\xbf\x39\x54\x54\xdf\xbc\x56\xfc\xe6\xa2\xf1\xad\x2c\xfd\x1a\x86\x63\x5b\x13\x9d\xc8\xe7\x4c\x95\x98\x4a\x84\xe8\x43\x2b\x45\x27\xf8\x96\x3b\x37\xcc\x22\x07\x3a\x61\x73\x1c\xb6\xf8\x41\x66\x36\xca\x36\x75\xad\x8d\x1b\x35\x75\x52\xb8\x45\x08\x76\xa7\xd3\x1b\xb7\xe3\xc1\x74\x03\x83\x54\x26\x45\x25\x5c\x26\x4a\xa5\x4d\xd2\xc2\x0b\xb5\x64\x52\xf0\x88\xe1\x97\x78\x24\x3f\x22\x63\x6f\x99\xd8\xaa\x1b\xc4\xcf\xb5\x2a\x44\xd9\xf1\x8a\xe1\x42\xf9\x9e\x3c\xdc\x2f\x8c\xd4\xaf\xda\x68\x04\x55\xcd\xa1\x88\x83\x15\x93\x10\xa9\xdd\x92\xc8\xc3\x70\xc6\xaa\x25\x21\xf5\xe5\xf1\x28\xa8\xd6\x95\x21\x8a\x77\xdb\x9f\xcd\x66\x46\xc3\xed\xf6\x0c\x0a\xa3\x2b\xfa\x3f\x64\xff\x76\x3b\x09\x31\x6c\xd7\x18\x22\x89\xc5\x9d\xb2\xe8\x8e\xc3\xea\x82\x33\x86\xb6\x17\xc5\xcd\x6
6\xd6\xfd\x7f\xb0\x97\x68\x4c\x56\xa2\x8b\xa7\x38\x45\xbd\x7f\x65\x42\x86\xe2\x52\xa2\xf3\xc7\xb0\x3f\x98\x71\x69\x00\xee\xda\x2b\x58\x34\x4b\x91\xe3\x0b\xb2\x05\x8d\x19\x31\xa4\x51\x15\x33\x76\xce\xa4\xcc\xa4\xce\x99\x4c\x35\x86\x28\xb6\x03\x44\xc1\x0a\xe0\x7e\x65\xe8\xb7\x76\x2a\x9a\x42\xb7\xd2\x66\x71\x14\x9e\x50\x0e\x8d\xc2\xe1\x66\xd4\xf7\xac\x70\xbf\x41\x9e\xac\x3f\xe7\x9d\x28\xe4\xba\xaa\x25\x52\x7c\xdb\x4b\x51\xd1\x48\xb9\x9e\x0a\x54\xf8\xfd\x1a\x47\xe1\x82\xb7\xa7\x30\xa0\x11\x58\x87\x05\xef\x1a\x05\xd7\x2b\xbb\x68\x09\x61\x6c\xbf\xd7\x94\x07\x06\x2b\xbd\x44\xa8\x99\x71\xc2\xf3\xc7\x30\x87\x1c\x98\xb5\xe8\x86\xc3\xbf\x63\x69\xce\x54\x8e\x32\x6d\xec\xe5\xab\x19\xfc\x12\x64\x88\x12\x4c\x65\x1b\xea\x80\xa8\x7f\xd8\x11\x3e\x26\xee\x7b\x60\x83\x91\xdf\x43\x1a\x8c\xfd\x64\xbc\x03\xe3\x37\x99\x42\xed\x81\x54\x4c\xb1\x12\xf9\x01\xce\xe9\x02\x38\x86\x38\x52\x2b\x73\x02\xed\xa0\xc3\xc0\x1b\x43\xf6\xb5\x48\xbb\xfb\xfc\xe3\xd2\x70\xc5\x8c\xca\xfc\x85\x93\x08\x7f\x8d\x86\xcc\x1c\x28\xbb
\xc4\x04\x16\xb8\x26\x1e\x40\xa5\x7e\xc5\x2c\x18\x74\x46\xe0\x92\xf8\x09\x15\x04\xaf\x6c\xd6\x2b\xa3\x1f\x3c\x59\x94\x12\xac\xd6\x0a\x6e\x90\x2c\x34\x98\x33\x0a\x4d\x1d\x6e\x0f\x5c\xfb\xb8\x34\x16\x41\x38\xd0\x8d\xb3\x74\x97\xd0\x05\xbc\x37\x6c\x29\x2c\xdc\x34\x42\xf2\x09\xae\x50\x9f\xea\xb5\x67\x06\x6b\xc9\xf2\xe4\x7e\x45\x8f\xb4\xe4\x3b\x4e\x89\xc0\x13\x37\x9b\x19\x91\x43\xb7\xae\x71\xbb\x0d\x3c\x31\xe1\xc4\x59\xf4\x82\xcc\x77\xad\x4e\x85\xab\x3d\x9d\xd6\x21\xdb\x6f\xf0\xb7\x9b\x50\x24\x11\x15\x53\x9c\x39\x6d\xd6\x03\xaf\x19\x64\x79\x27\xe7\x11\x76\x76\x46\x58\x68\x75\x25\xf1\x7c\xb0\x1e\x0d\xd0\xce\x75\x23\x39\x05\xc5\xa2\x9b\x41\xb8\xba\xec\xdf\xfd\x48\xda\x8f\x88\xab\xce\x46\x1b\x72\xbc\xb6\x78\x42\x40\xa9\xf9\x15\xf3\x21\xfa\x16\x6d\xf1\xbc\x80\x7b\x34\x4e\xc3\x96\xb0\xee\x1c\x4b\xbf\x91\x7e\x3e\xde\xab\x6e\x5d\x6b\x5c\xcb\x2e\xbc\x50\xb5\xa3\xa4\xda\xbb\x70\xfa\xd9\x78\xbf\x1c\xab\xf3\x14\x65\x8e\x35\x2a\x8e\x2a\x4f\x3e\x46\x44\x51\xe8\x45\x43\x2a\x05\x1b\x66\xb3\x01\x9c\x58\
x12\x26\x21\x7d\xe8\x85\x8f\xc1\xea\x97\xdc\xe9\xec\xc9\x97\xcb\xf3\x7b\x61\x60\xce\x2c\xdc\x20\xaa\xbd\x56\xd3\x55\xb0\xb1\x0e\x7a\x8f\x15\x54\x9f\x1b\x93\xe2\xdf\xe7\xb7\xca\xf3\xbd\x36\xfd\x73\x8c\x20\xfa\x73\xb7\x77\x3f\x4e\x5c\xa3\xde\xe9\x91\xbd\xd3\xd8\xd3\xb1\xbd\xdb\xfc\x0e\x8f\xee\x90\x55\x5d\x07\xd6\x8d\xe2\x59\xdb\x5a\x33\xdf\x5a\xd3\x27\x4a\xa2\xa3\x24\xef\xca\xc3\xae\x25\x6d\x63\xf2\x2d\x8c\xf6\xad\x6d\x60\x74\xfe\xf3\xc6\x18\x72\x23\xf6\xe2\xb6\x00\x85\xe7\x98\x30\x26\x0d\xcc\xfa\xbd\x26\x6f\x27\xb3\x0a\xaa\x6e\xb9\x41\xe6\x70\xd8\x76\xff\xd1\x01\xbc\xe4\x9e\x07\xfe\xd5\xc5\x7f\xad\x80\x0a\xad\x65\xe5\xce\xf5\x02\x98\xe2\xed\x5c\xae\x79\x98\xa0\xc1\x84\x1b\x50\x88\xe7\x14\x93\xf8\x9d\xa0\xfe\x08\x93\xbc\x1d\x7d\xf5\x1c\x2d\x99\xf7\xee\xf0\x60\x15\x6b\x21\x76\x0a\xe7\x84\x6a\x79\x34\x4c\x3c\x78\x23\xc7\xf9\x5e\xfd\x0f\x28\x92\xb7\x9c\x7c\x4c\xfc\x89\xc5\x84\x92\xab\x40\xe4\x99\x50\x4b\xbd\x48\x15\x8f\xfe\x76\x1d\xc4\xfc\x29\xa4\x65\xb0\x9a\xa3\xea\x73\xce\x19\x51\x96\x
68\xda\xa9\xc7\xcf\xbb\x8e\x44\x7a\xae\xe2\xdf\xa0\x2d\x5b\x0e\x12\xc8\xc0\x6f\x0a\x6d\xee\xa1\x61\xfe\xfd\x8e\xd6\x47\x52\x19\x0b\x4b\xfb\x05\x88\x2a\x47\xd7\x4b\xc6\x0d\x13\xe1\x71\xae\x37\xf0\x01\x66\x79\x4d\xe3\x90\xfe\xd9\xcf\x66\x15\x56\xc4\x0f\xad\xf8\x9e\xc2\x0c\x12\x57\xe2\xbb\xa7\xed\x61\xd9\x1e\x6b\xea\x49\x22\x53\xfe\xd9\x80\xf6\xf1\x06\xdd\x8a\x32\xeb\xd9\xf3\xff\xfb\x1d\xfb\xdf\xb3\xe7\x93\x6d\x72\xa2\x42\xdd\xa4\x58\x61\x3b\x7b\x94\x31\x4f\x9f\x7a\x63\xfe\xfb\x94\xfe\x0e\x8d\x91\xd4\xe5\x50\x9c\xa4\x2e\x8f\x0d\x52\xb0\xea\xd9\x54\x8b\xda\x67\x73\x76\x93\xfc\x78\xf7\x47\xf7\xba\xdb\xd1\x5c\x1b\x53\x54\xae\x43\x9b\xee\x74\xcc\xe0\xa2\x54\xda\x5f\x51\x29\xab\x94\x5e\xcd\x7a\x22\x7f\xf2\xe5\xe4\xef\x00\x00\x00\xff\xff\x29\x1e\x68\xe0\x5e\x1f\x00\x00")
+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\xd7\x4e\x8a\x02\x85\x81\x43\xe1\xd6\xd7\xe4\x9a\xd8\x67\xdc\x23\x41\xe0\x1c\xd6\xd4\x72\x24\x31\xe2\x92\x0b\x92\x2b\x59\x3e\xa8\x9f\xbd\x18\x72\x5f\xba\x3b\xee\x52\x72\x8c\xe6\x9f\xac\x8f\xc3\xf9\xcd\x83\x9c\x17\xf5\xe1\x09\xc0\xdd\x13\x00\x80\xa7\x82\x3f\x7d\x05\x4f\x4b\xbb\xc8\x2b\x83\x73\xf1\x29\x47\x63\xb4\x79\x7a\x12\x56\x9d\x61\xca\x4a\xe6\x84\x56\x44\x76\xe6\xd7\x9e\x00\xec\x4e\x46\x38\x08\x35\xd7\x11\x06\xe7\xb4\x34\xb5\xdf\xd6\x45\x81\xd6\x46\x58\x5c\x35\xab\x53\x5c\x36\xcc\x28\xa1\x16\x11\x2e\xbf\x36\xab\x51\x2e\x45\xc9\x73\x8e\xb6\xc8\xa5\x56\x8b\xbc\xaa\x67\x52\xd8\x65\x84\xd9\xfb\xb0\x0a\x0c\x2a\x56\xac\xd8\x02\xc1\x69\x70\x4b\x04\x83\x0b\x61\x9d\xd9\x82\x45\x07\x42\xc1\x7f\x5f\x64\x1b\xbb\xaa\x8c\xae\x6c\x96\x0a\x6d\xb0\xd2\xc6\x45\x90\x2f\xfd\xa2\x05\xad\x80\x63\x25\xf5\x16\x39\xa0\x72\xc2\x09\xb4\xf0\x8d\xc8\x30\x3b\x81\
xf7\x41\x26\x7b\x02\xaf\x0b\xda\x67\x4f\xe0\xda\x88\xc5\x02\x8d\x3d\x81\xcb\x5a\xd2\x0a\xba\x22\xfb\x16\x98\x85\x0d\x4a\x49\xff\x37\x58\xa0\x72\x7e\xc7\xda\xa3\x59\x92\x9f\x74\xb2\x15\x16\x62\x2e\x90\x83\x62\x25\xda\x8a\x15\x98\xae\x8b\xd6\x31\x4d\x5e\x83\xd3\x5a\x92\xe1\x82\x22\x27\x50\xab\xf0\x05\x4c\x71\xb0\x5b\x55\x80\xae\x50\x6d\x96\xc2\xae\x5a\x3b\x5b\xa8\xad\x50\x0b\x60\x50\x32\x25\xe6\x68\x9d\x27\xd6\x15\x71\x65\xb2\x61\x55\x92\x26\x73\x21\x3b\xf2\xdf\x5e\xbf\xfd\x39\x45\x66\xbb\xd4\xc6\x1d\xe3\x7b\xd6\x79\x3e\x1d\x66\xd4\xcf\xef\x8d\x5e\x0b\x8e\x16\x18\xd8\xba\x2c\x99\xd9\x42\xa0\x07\x3d\x87\xcd\x92\xb9\x67\x16\x66\x88\x83\x53\xf0\x65\xde\x6a\x44\x9a\x74\x17\x9d\x6b\xa7\x61\x89\xb2\x6a\xa0\x61\xab\x6b\x93\xe4\x29\xf2\x48\xba\x2c\x8c\xf3\x98\x28\x9c\x03\x53\xc0\xfc\xe1\x3e\x81\x39\x22\x3f\x01\x17\x4e\x38\x68\x03\xa6\x96\xdd\x85\x6c\xc1\x0f\x81\xcd\xfd\x85\xda\x8e\xa1\xbf\x60\x0a\xee\xee\xb2\x15\x6e\x77\xbb\xfb\x50\x5e\xcf\x64\xbc\x35\x1a\x4b\x9c\x63\xc7\x40\x28\xe7\xb9\x37\x
74\xa0\xea\x72\x46\x6a\xce\x61\x63\x57\xc1\x03\xe3\x58\x73\xc9\x16\x39\xab\x44\xbe\xd4\x36\xe6\xdc\xe0\xb9\xd7\xef\xcf\xe1\xe3\x8f\x17\x57\xd7\x1f\x13\x39\x8e\xcb\x3e\x60\xfa\xcb\xd9\xe5\xd5\xf9\xc5\xbb\x24\xbe\xb5\x5b\xe6\x2b\x8c\x59\x9f\x96\xb5\x11\x9f\xfd\x1f\xe0\xe3\x4f\x67\xbf\xa5\x30\x2d\xd0\xb8\xdc\xbb\xe5\x71\xae\x15\x73\x4b\x32\x29\x19\x3a\x23\xe2\x04\x1f\x06\xc6\x5a\xcd\x45\x2c\xe5\x84\x45\xcf\x0a\xbe\xe1\x38\x67\xb5\x74\x20\x2c\xfc\xe5\xc7\x8b\xb7\x67\x7d\x62\xf8\x36\xc5\x2a\x52\xea\x4d\xde\xf0\x88\x25\x4a\x4f\x04\x1d\xd1\x34\xd7\x3e\x5a\x8e\xd9\xa5\x8b\xd0\x5d\x58\x4d\x60\x2d\x94\x43\x43\x37\x74\x1d\xb3\x79\x90\x76\x40\x07\x95\xd1\x65\x95\x24\xf8\x0a\xb7\xc9\xee\x5c\xe1\x36\x55\xe8\x60\xe5\x92\x29\xb6\xc0\x58\xf0\x09\x62\x57\x46\xff\x81\x85\xeb\x53\xaf\xd3\x30\xa3\x10\x60\x56\xc8\xa1\xe5\x30\x8d\xd8\x85\xa7\x71\xfb\x1f\x10\x5a\x3c\xdb\x2e\xf4\x47\xf8\xf6\xeb\xd3\xbc\x1a\x55\x27\x24\xb4\x68\xd6\x68\x24\x5a\xdb\xda\x26\x81\xb5\x75\x46\x44\x39\x07\x43\xd7\x16\x0d\x1d\x69\xa
1\x90\x83\xa9\x95\x13\x65\x17\x0b\x13\x10\x9c\x5e\x2c\x24\xe6\x94\xae\x22\x30\xd7\x9e\x02\x7e\xa4\x84\x56\xa2\xb5\x6c\x91\x7e\x52\xd6\x68\x66\xda\xc6\x8c\xdc\xac\x82\xae\x5d\x55\x8f\x99\xc3\x87\x89\xbc\x14\x96\x12\xa6\x0f\x80\xf1\xf8\x77\xbd\x44\x20\x0a\x3a\x78\x45\x08\x82\x74\xc0\x85\x05\xa5\x1d\x04\x56\xb5\x41\x9e\xfd\x3e\x66\x9e\x7b\x88\x95\x18\xc9\x0d\x84\x48\x41\x9c\x48\xbe\x0c\x67\xea\x54\x12\x52\x47\x73\x1c\x54\xa3\xca\x58\x47\x72\x5f\x9f\x0f\x77\x77\x19\x7d\xef\x76\xb7\x27\x30\x37\xba\xa4\xc4\x6e\x75\x6d\x0a\xdc\xed\x92\x30\x83\xc3\xa6\x30\x89\xac\xf5\x95\x45\x77\x1c\x56\x67\x9e\x29\xb4\x3d\x3b\x92\x8a\xdd\x1f\x0e\xd7\xb3\x56\x25\x33\x76\xc9\xa4\xcc\xa5\x2e\x98\x8c\xc0\xde\xb4\x64\x70\x51\xa1\xfa\xd5\x67\x7f\x92\x32\x80\xf9\x9d\xb0\x66\xb2\x46\x9b\x8a\xa6\xd0\x6d\xb4\x59\x1d\x85\xe7\x13\x8b\x42\x37\x8a\xd5\xe7\xb5\xbc\x60\xaa\x40\x29\xa3\x71\xff\xe2\xa7\x0c\xfe\x15\x68\xa8\xac\xed\x77\xa6\x02\xcc\x99\x88\x73\x7f\xd3\x27\x58\x2e\x78\x73\xf0\xcb\x4a\xa2\x43\xb0\x35\xb5\xbf\xf3
\x5a\xca\x6d\x06\x97\xb5\x82\x8f\x5d\xe5\xd7\xb5\x4c\x1f\x29\x06\x1b\x2c\x35\xa5\x51\x66\x9c\x60\x52\x6e\xfb\xde\x80\x59\x8b\x6e\xdc\xec\x03\x49\x43\xa3\x91\x5b\xc7\x5c\x1d\xab\x35\x9e\x3f\x7f\xfe\xfc\xf4\xf4\xf4\x74\x60\xfb\x81\x0e\x57\x7e\x2b\x10\x01\x11\x26\xa1\xfa\x21\x00\xf2\x14\x13\xb5\xa6\xe1\xd0\x4c\x0e\x82\x71\xc6\x4f\xd5\xf1\xbe\x1e\xee\x4d\x07\x19\xf5\xf7\xcd\x80\x72\xdc\xe3\xc9\x78\x53\xf6\xdb\x83\x3c\xc2\x82\x6d\x0d\x92\xfb\xbe\x6e\xba\x76\xbc\xf1\xed\x1f\x85\x1e\xaa\x11\x76\xbb\x5b\x98\x6b\x93\x7a\x6f\xee\x81\x0d\x15\x3d\x08\x2e\xd9\x75\xa1\xe5\xcb\xdb\x1b\x33\x31\x92\xea\x5a\xbf\x36\xb2\x12\xde\x92\x35\x2d\xf9\xd0\xa4\xdd\x1d\x4c\x47\x8f\xcf\xb0\xde\xb4\xeb\xf0\xa8\x00\x59\x36\xd2\x5d\x37\x10\xad\x41\xfe\x4c\x15\x7b\x9e\x29\x4a\xb6\xd4\x71\x35\x6f\x7a\x8a\x23\x14\xe5\x58\xa1\xe2\xa8\x8a\x43\xec\xd9\x6f\x1a\x02\x1d\x86\xd3\xdf\xc2\xa8\x51\xdf\x3c\x0a\xf3\x25\x27\xe7\x71\x29\x28\xf6\xd4\x26\x56\x67\x0d\x22\xa9\x9e\x47\x54\xff\x3f\xa6\xa1\x56\x9f\xc3\x0e\xca\x97\x79\xf0\
x61\x24\xfd\x73\x7c\x98\x78\x35\x62\x92\x8c\xfb\x71\x2f\xa2\x1f\xe9\xc9\x89\x20\x4c\x6d\xec\xb1\x69\xcd\x4b\x14\x92\x4c\xd7\x26\x8f\xc9\x02\xbc\x36\xe4\xc9\x06\x76\x98\x2a\xbe\xde\x79\x6b\x75\x9c\xeb\x5a\xf1\xbc\x91\x77\x7c\x00\xf8\x86\x88\xa2\xb1\x69\xb3\x14\xc5\x12\x36\x7e\xa2\x4e\x72\xf1\x50\x8e\xba\x25\x42\x51\x1b\x43\x86\x69\x15\x6c\x87\x08\x3e\x69\x85\x6f\xe2\xc0\xac\xd7\x85\xec\x97\x9c\xbe\xc2\xe8\x64\xa2\x93\xfb\x5d\xbd\x97\xc8\xac\x1f\xb4\xac\x05\x47\x2f\x14\xd1\x93\xec\x3e\x5d\x76\xc5\xdc\x2b\x98\xc6\x1a\xed\x53\x1f\x60\x31\x75\xbf\x6f\x75\x7a\x85\x2a\x01\xa8\x19\x72\x46\x9c\xa1\x61\xab\x6b\x30\xe8\x3d\xbf\x61\xca\xf5\xf3\x2a\x70\x4b\x61\xff\x01\xdf\x6c\x5f\xbc\xfb\x36\x01\x67\xaa\x3d\x7d\xa8\xd2\xa0\xcb\xfa\xd0\xce\xf7\x7c\x87\x43\x4d\xd7\xa2\x46\xeb\x6e\x13\x70\x5b\x27\x1f\xa4\x61\xf7\x56\x92\xa0\xe3\xd9\xe5\xe5\xc5\xe5\x55\x84\xfd\xe9\xfd\xff\x20\x90\xc3\x83\x85\xd3\xd3\x91\xdc\x6e\xcc\x7e\x10\x5b\x29\xbd\x51\xb9\xdb\x56\x23\x49\xa8\x0d\x56\x44\x45\x16\x6b\x76\x65\xd0\x
8f\xb6\x41\x2b\xb9\x05\x5b\x57\xe1\xd5\xeb\x85\x9f\x29\x67\x76\x6b\x1d\x96\x30\x13\x8a\x0b\xb5\xb0\xa0\x0d\x2c\x84\x5b\xd6\xb3\xac\xd0\x65\xf7\x00\x31\x5e\x8c\x04\x81\xdb\xa8\x46\x8e\xcc\x95\x76\x21\x0e\x8c\xf4\xd5\x8f\xde\x79\xa1\xee\x4f\x48\x7d\x90\xf3\xbc\x68\x71\xff\x05\x64\x4a\xac\xa6\x4e\x2a\x0c\x32\x17\xb3\x9e\x7f\x97\x05\x4f\xb2\x17\x89\x36\xc2\x2d\xc1\x3f\xe8\xb6\xc3\xac\x57\xb4\x88\xc6\xec\x76\xfe\xa5\x2c\xac\x15\x9a\x87\x05\xfa\x98\xe8\xfe\x07\x22\x85\xf0\x38\x2a\x12\x7f\x10\x1c\xbf\x92\x48\x73\x44\x9e\x0b\xb5\xd6\xab\x98\x40\xff\xf6\x99\x8a\x2e\x4b\x20\xf3\xe1\x8e\xb6\xc1\x66\xe9\x1f\xce\x1a\x49\xdb\x97\xa3\xb0\xf4\x75\xa4\x5d\xe1\xb6\x1b\x83\x95\x4c\x71\xe6\xb4\x19\x1b\xf1\x75\x34\x7e\x62\xf4\xa1\x35\xe6\x2d\x5d\x93\x86\xcf\x24\x66\xd7\x43\x4d\x9d\xeb\xb7\xc3\xe3\x39\x38\xb9\xcc\x81\x1f\xef\x0e\x9a\xaa\x49\x50\x7f\x91\x4a\x61\x4b\xe6\x8a\xd8\x0b\xea\xde\x3d\xa2\x0d\xdc\x43\xf0\x91\xeb\xe4\xd7\xdb\xc6\x8e\x6b\x0c\xb3\x41\x0f\xe2\xdd\xea\x33\x18\x11\x95\x03\x26\x7b\xd7\x2
e\xac\xb6\x6a\x8c\x2b\xd1\xcc\x99\xe9\x78\x31\x29\x62\x66\x3b\x0f\xab\x14\x7d\x1a\x97\x74\x03\x6a\xc2\x6a\xbe\x49\x96\xfe\x4d\x76\x4f\x2a\x6d\xbc\xec\xe1\x1d\xd3\xef\x09\x9f\x29\x76\x6e\x45\x9c\x30\xf5\xe5\x21\x02\xdd\xb3\xab\xbf\x0a\x41\xa2\x67\x16\xc2\xa4\x30\x98\x12\x3f\x39\x54\xb6\x15\x1a\x3f\xb9\xb6\xdd\xfe\x12\x55\x6c\xbe\xc0\x58\xe5\xd2\x5f\xe5\x05\x86\xe7\xd0\x26\x25\xf4\x8f\x02\x36\xd4\x59\xfd\x38\xca\xa2\x59\x8b\x62\x70\x7d\x27\x05\xa9\x8d\x3c\xdc\xe5\x77\x77\x59\x6d\x24\xa5\xb0\xdd\x0e\x6e\x2e\x7f\xf6\xca\xd7\x46\x36\x67\x90\xfe\x45\x36\x0b\x04\xb7\x69\x19\x80\x04\x29\x99\x9c\x6b\x53\x46\x4b\xed\xb7\xed\xfa\x98\x04\x19\x5c\x9b\x2d\xb0\x05\x13\x2a\xcb\x26\x61\xff\xb0\x5a\x75\x51\xaa\x28\xf9\xc8\x33\xec\x7f\xae\x2e\xde\x81\x50\x55\xed\x80\x33\xc7\xe0\x6d\x63\x8d\x67\x45\xc9\x9f\x51\xcc\x7a\x1c\xe9\xd7\xd7\x97\xef\xce\xdf\xfd\x90\x5e\x8b\xb4\x1b\x0e\xab\x46\x36\xcc\xa8\xbc\xd0\x25\x45\xd1\xdc\xa0\x8b\x86\xda\x4b\x5a\x6b\xe7\x46\x45\xc9\x7d\xf9\x3d\x77\x68\x42\x98\x7f\x15\xce
\x37\x1d\x9e\xdb\x31\xe3\x35\x78\x7e\x42\x7f\xf0\x01\x1a\xbe\x12\x0f\xc7\x57\x1c\x1d\x16\x6e\xa2\x71\xf4\xc8\x94\x5c\x38\x56\x06\x0b\x46\xcd\x8b\xc1\x4a\xb2\x22\x7a\x70\x28\xfa\x12\x8e\x96\xbc\xc9\x29\xfe\x51\x22\xfc\x7a\x64\xef\xb4\x06\x99\x36\x42\x4a\xb0\x5a\x2b\x98\x21\xf4\x30\x27\x50\x85\x6a\xb8\xb6\x21\xb3\xfa\x82\x08\x37\x7b\x3c\xad\x43\x96\xa8\x40\x63\x8e\x63\x72\xa2\x5d\xea\x5a\x72\x12\xcf\xa2\xcb\x20\x4c\x02\xf7\xeb\x71\xa2\xf6\x5f\x61\x26\x90\x24\x91\xa7\x9f\xf0\x27\xc9\x15\x10\x28\xfc\x3d\xcc\xd5\x14\x4d\xfd\xfe\x43\x20\x29\x5f\x5b\xb6\x1e\xf5\xe0\x14\xa8\xdf\xdf\x7a\xb5\x6d\x3c\xdb\xdf\x90\x0c\x7f\x3c\x32\x2d\x98\x14\xa5\x70\xb9\x58\x28\x6d\xa2\x22\xb5\xe7\xba\x49\x00\x7e\x8b\x97\xca\x7f\xdd\xcf\xc7\xc2\x42\xc3\x2e\x15\xbd\x58\x32\xb5\x40\x36\x8b\x3e\xf9\xff\xdc\x21\x76\x05\x80\x6d\xf5\x96\xdb\x30\x73\xe8\x78\x64\x70\x4e\xf0\x54\x44\x25\x9c\x05\x2f\x81\xcd\xa5\x5e\xe4\x56\x7c\x8e\x09\x20\xf5\xe2\x4a\x7c\x46\xb2\x6d\xd8\xb0\xa7\x71\x7f\x44\x99\xf2\x4f\x53\x54\x70\xce\xd0\
x6d\x10\x15\xbc\xf4\x85\xe5\x77\x2f\x93\x45\x29\xb1\xd4\x66\x3b\x26\x4d\xa0\x38\x56\xa0\xef\xbe\xff\xbb\x17\xe9\x6f\xdf\x7d\x9f\x2c\x13\xe5\x60\x5d\xc7\x12\x78\xb3\x7a\x94\x30\x2f\x83\x7d\xfe\xfa\x92\xfe\x9b\x96\xc7\xb7\x88\xd4\x5b\x57\x68\x9c\xc0\xd8\x18\xaf\x0d\x83\x83\x78\x15\x86\x36\xce\x08\xec\xc6\x36\xa1\xdf\xec\x99\xb5\xe3\x9d\xc7\x63\x62\x1b\x12\xb9\xf6\x07\x8e\x22\xa3\x70\xa0\x6b\x67\x05\xf7\x8e\xb8\x36\x6c\x2d\x2c\xcc\x6a\x21\xf9\x78\x7f\xea\x55\x09\xe1\xc0\xd0\xb1\x4d\x0a\x05\xdd\xe9\xdf\x0b\x08\xea\x5e\x54\x6f\xac\xed\xbb\xee\xbb\xbb\xac\xf9\x6b\x6b\x6e\xaa\x92\x85\x6a\x9a\x1d\xfa\x07\x2b\x26\x4a\x27\x2f\x6a\x5b\x8f\x86\x4b\x16\x0b\x13\x6d\x39\xda\x50\x51\x41\x77\xaf\x32\x9d\x31\x8b\x1c\xb4\x1a\x54\xc6\xd1\xe2\xf3\xa8\x8a\xd3\x4b\xdb\xf4\xb3\xbe\x59\xc1\x4f\xc2\x46\x7f\x52\xf5\xa0\x55\xd9\x0b\x31\x4c\x1a\x64\x7c\x0b\x81\x45\x06\xcd\x7c\xc8\xa2\xc4\xc2\x01\x53\xda\x2d\xd1\xf8\x6d\x51\x91\xde\x9c\xfd\xf3\xe6\x87\xe4\x72\xc8\x53\x1f\x56\x0b\xf1\x59\xf8\xb9\xd4\x1a\x8d\x98\x
c7\xea\xa0\x5f\xfc\x62\x53\xce\x3e\x3c\x42\x8d\x7e\xe3\xb1\x92\x80\xba\x71\x7c\x78\xb7\x9b\x7c\x76\xf1\x54\xaf\xa6\xb8\x0e\x1e\x02\x46\xf9\x0e\x9f\x03\xd2\x38\x5b\x64\xa6\x58\x12\xdf\x66\xfe\x9a\x73\x61\xb0\x18\x69\xce\xaf\xda\x1d\xdd\xf4\xb6\xdb\xf1\xe0\xf1\xb1\xb7\x60\x6f\xba\x27\xb7\x4f\xfe\x17\x00\x00\xff\xff\x5a\x51\x51\x15\x8c\x2f\x00\x00")
func wski18nResourcesEn_usAllJsonBytes() ([]byte, error) {
return bindataRead(
@@ -112,7 +112,7 @@ func wski18nResourcesEn_usAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 8030, mode: os.FileMode(420), modTime: time.Unix(1515789236, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 12172, mode: os.FileMode(420), modTime: time.Unix(1516809631, 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 46e9f6a0..99aede82 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -4,28 +4,52 @@
"translation": "Error"
},
{
- "id": "msg_prefix_warning",
- "translation": "Warning"
+ "id": "msg_prefix_info",
+ "translation": "Info"
},
{
"id": "msg_prefix_success",
"translation": "Success"
},
{
- "id": "msg_prefix_info",
- "translation": "Info"
+ "id": "msg_prefix_warning",
+ "translation": "Warning"
},
{
- "id": "msg_json_missing_cmd_key",
- "translation": "JSON input data Missing 'cmd' key"
+ "id": "msg_cmd_desc_long_publish",
+ "translation": "Publish a package to the registry set in ~/.wskprops."
},
{
- "id": "msg_cmd_flag_namespace",
- "translation": "namespace"
+ "id": "msg_cmd_desc_long_report",
+ "translation": "Reports on deployed entities (i.e., Packages, Actions, Triggers, Rules, etc.) as well as recent Activations in the specified namespace."
},
{
- "id": "msg_cmd_flag_auth_key",
- "translation": "authorization `KEY`"
+ "id": "msg_cmd_desc_long_root",
+ "translation": "A tool to deploy, undeploy and sync openwhisk packages using a manifest and optional deployment files using YAML."
+ },
+ {
+ "id": "msg_cmd_desc_short_publish",
+ "translation": "Publish a package to a registry."
+ },
+ {
+ "id": "msg_cmd_desc_short_report",
+ "translation": "Provides a summary report of what's been deployed in the specified namespace."
+ },
+ {
+ "id": "msg_cmd_desc_short_root",
+ "translation": "A tool set to help deploy your openwhisk packages using a manifest file."
+ },
+ {
+ "id": "msg_cmd_desc_short_add",
+ "translation": "Add an action, feed, trigger or rule to the manifest"
+ },
+ {
+ "id": "msg_cmd_desc_short_add_entity",
+ "translation": "Add a/an {{.key}} to the manifest file"
+ },
+ {
+ "id": "msg_cmd_desc_short_version",
+ "translation": "Print the version number of wskdeploy"
},
{
"id": "msg_cmd_flag_api_host",
@@ -36,60 +60,60 @@
"translation": "whisk API `VERSION`"
},
{
- "id": "msg_cmd_flag_key_file",
- "translation": "path of the .key file"
+ "id": "msg_cmd_flag_auth_key",
+ "translation": "authorization `KEY`"
},
{
"id": "msg_cmd_flag_cert_file",
"translation": "path of the .cert file"
},
{
- "id": "msg_prompt_deploy",
- "translation": "Do you really want to deploy this? (y/N): "
+ "id": "msg_cmd_flag_config",
+ "translation": "config file (default is $HOME/.wskprops)"
},
{
- "id": "msg_prompt_undeploy",
- "translation": "Do you really want to undeploy this? (y/N): "
+ "id": "msg_cmd_flag_allow_defaults",
+ "translation": "allow defaults"
},
{
- "id": "msg_prompt_authkey",
- "translation": "\nPlease provide an authentication token: "
+ "id": "msg_cmd_flag_deployment",
+ "translation": "path to deployment file"
},
{
- "id": "msg_prompt_apihost",
- "translation": "\nPlease provide the hostname for OpenWhisk: "
+ "id": "msg_cmd_flag_interactive",
+ "translation": "allow interactive prompts"
},
{
- "id": "msg_prompt_namespace",
- "translation": "\nPlease provide a namespace [default value is guest]: "
+ "id": "msg_cmd_flag_key_file",
+ "translation": "path of the .key file"
},
{
- "id": "msg_manifest_not_found",
- "translation": "Manifest file not found at path [{{.path}}].\n"
+ "id": "msg_cmd_flag_allow_managed",
+ "translation": "allow project entities to be marked managed"
},
{
- "id": "msg_using_manifest_deploy",
- "translation": "Using [{{.path}}] for deployment.\n"
+ "id": "msg_cmd_flag_manifest",
+ "translation": "path to manifest file"
},
{
- "id": "msg_using_manifest_undeploy",
- "translation": "Using [{{.path}}] for undeployment.\n"
+ "id": "msg_cmd_flag_namespace",
+ "translation": "namespace"
},
{
- "id": "msg_runtime_mismatch",
- "translation": "Runtime [{{.runtime}}] specified in manifest does not match with action source file extension [{{.ext}}] for action [{{.action}}].\n"
+ "id": "msg_cmd_flag_project",
+ "translation": "path to serverless project"
},
{
- "id": "msg_runtime_changed",
- "translation": "Runtime changed to [{{.runtime}}] based on the action source file extension for action [{{.action}}].\n"
+ "id": "msg_cmd_flag_strict",
+ "translation": "allow user defined runtime version"
},
{
- "id": "msg_runtime_unsupported",
- "translation": "Runtime [{{.runtime}}] specified in manifest is not supported for the action [{{.action}}].\n"
+ "id": "msg_cmd_flag_toggle_help",
+ "translation": "Toggle Help message"
},
{
- "id": "msg_action_limit_ignored",
- "translation": "Invalid action limit [{{.limit}}] in manifest is ignored.\n"
+ "id": "msg_cmd_flag_allow_verbose",
+ "translation": "verbose output"
},
{
"id": "msg_config_missing_authkey",
@@ -105,7 +129,7 @@
},
{
"id": "msg_config_apihost_info",
- "translation": "The API host is {{.host}}, from {{.source}}.\n"
+ "translation": "The API host is [{{.host}}], from {{.source}}.\n"
},
{
"id": "msg_config_authkey_info",
@@ -113,11 +137,7 @@
},
{
"id": "msg_config_namespace_info",
- "translation": "The namespace is {{.namespace}}, from {{.source}}.\n"
- },
- {
- "id": "msg_err_get_runtimes",
- "translation": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n"
+ "translation": "The namespace is [{{.namespace}}], from {{.source}}.\n"
},
{
"id": "msg_unmarshall_local",
@@ -128,58 +148,60 @@
"translation": "Unmarshal OpenWhisk info from internet.\n"
},
{
- "id": "msg_deployment_succeeded",
- "translation": "Deployment completed successfully.\n"
+ "id": "msg_deployment_cancelled",
+ "translation": "OK. Cancelling deployment.\n"
},
{
"id": "msg_deployment_failed",
"translation": "Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
},
{
- "id": "msg_deployment_cancelled",
- "translation": "OK. Cancelling deployment.\n"
+ "id": "msg_deployment_report_status",
+ "translation": "----==== OpenWhisk Deployment Status ====----"
},
{
- "id": "msg_undeployment_succeeded",
- "translation": "Undeployment completed successfully.\n"
+ "id": "msg_deployment_succeeded",
+ "translation": "Deployment completed successfully.\n"
+ },
+ {
+ "id": "msg_undeployment_cancelled",
+ "translation": "OK. Cancelling undeployment.\n"
},
{
"id": "msg_undeployment_failed",
"translation": "Undeployment did not complete sucessfully.\n"
},
{
- "id": "msg_undeployment_cancelled",
- "translation": "OK. Cancelling undeployment.\n"
+ "id": "msg_undeployment_succeeded",
+ "translation": "Undeployment completed successfully.\n"
},
{
- "id": "msg_undeployment_managed_failed",
- "translation": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
+ "id": "msg_manifest_using_deployment",
+ "translation": "Using [{{.path}}] for deployment.\n"
},
{
- "id": "msg_warn_whisk_properties",
- "translation": "The [{{.key}}] key was retrieved from whisk.properties which will soon be deprecated please do not use it outside of Travis builds.\n"
+ "id": "msg_manifest_using_undeployment",
+ "translation": "Using [{{.path}}] for undeployment.\n"
},
{
- "id": "msg_warn_key_deprecated_replaced",
- "translation": "The [{{.oldkey}}] key in the {{.filetype}} file will soon be deprecated, please use the [{{.newkey}}] key instead.\n"
- },
- { "id": "msg_err_missing_mandatory_key",
- "translation": "The mandatory key [{{.key}}] is missing.\n"
+ "id": "msg_entity_deployed_success",
+ "translation": "{{.key}} [{{.name}}] has been successfully deployed.\n"
},
- { "id": "msg_warn_missing_mandatory_key",
- "translation": "The mandatory key [{{.key}}] should be set. Using default value [{{.value}}]...\n"
+ {
+ "id": "msg_entity_deploying",
+ "translation": "Deploying {{.key}} [{{.name}}] ..."
},
{
- "id": "msg_err_mismatch_name_project",
- "translation": "The {{.key}} named [{{.dname}}] in deployment file [{{.dpath}}] does not match the name [{{.mname}}] in manifest file [{{.mpath}}]."
+ "id": "msg_entity_undeployed_success",
+ "translation": "{{.key}} [{{.name}}] has been successfully undeployed.\n"
},
{
- "id": "msg_deploying_dependency",
- "translation": "Deploying dependency [{{.name}}]..."
+ "id": "msg_entity_undeploying",
+ "translation": "Undeploying {{.key}} [{{.name}}] ..."
},
{
- "id": "msg_undeploying_dependency",
- "translation": "Undeploying dependency [{{.name}}]..."
+ "id": "msg_dependency_deploying",
+ "translation": "Deploying dependency [{{.name}}]..."
},
{
"id": "msg_dependency_deployment_success",
@@ -189,6 +211,10 @@
"id": "msg_dependency_deployment_failure",
"translation": "Deployment of dependency [{{.name}}] did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
},
+ {
+ "id": "msg_dependency_undeploying",
+ "translation": "Undeploying dependency [{{.name}}]..."
+ },
{
"id": "msg_dependency_undeployment_success",
"translation": "Dependency [{{.name}}] has been successfully undeployed.\n"
@@ -197,45 +223,133 @@
"id": "msg_dependency_undeployment_failure",
"translation": "Undeployment of dependency [{{.name}}] did not complete sucessfully.\n"
},
+ {
+ "id": "msg_managed_undeployment_failed",
+ "translation": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
+ },
{
"id": "msg_managed_found_deleted_entity",
"translation": "Deleting {{.key}} [{{.name}}] which was removed from the current managed project [{{.project}}] as part of undeployment.\n"
},
{
- "id": "msg_err_create_entity",
- "translation": "Error creating {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
+ "id": "msg_prompt_apihost",
+ "translation": "\nPlease provide the hostname for OpenWhisk: "
},
{
- "id": "msg_err_delete_entity",
- "translation": "Error deleting {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
+ "id": "msg_prompt_authkey",
+ "translation": "\nPlease provide an authentication token: "
},
{
- "id": "msg_entity_deploying",
- "translation": "Deploying {{.key}} [{{.name}}] ..."
+ "id": "msg_prompt_deploy",
+ "translation": "Do you really want to deploy this? (y/N): "
},
{
- "id": "msg_entity_undeploying",
- "translation": "Undeploying {{.key}} [{{.name}}] ..."
+ "id": "msg_prompt_namespace",
+ "translation": "\nPlease provide a namespace [default value is guest]: "
},
{
- "id": "msg_entity_deployed_success",
- "translation": "{{.key}} [{{.name}}] has been successfully deployed.\n"
+ "id": "msg_prompt_undeploy",
+ "translation": "Do you really want to undeploy this? (y/N): "
},
{
- "id": "msg_entity_undeployed_success",
- "translation": "{{.key}} [{{.name}}] has been successfully undeployed.\n"
+ "id": "ERRORS",
+ "translation": "================= ERRORS ==================="
+ },
+ {
+ "id": "msg_err_dependency_unknown_type",
+ "translation": "Dependency type is unknown. wskdeploy only supports /whisk.system bindings or github.com packages.\n"
+ },
+ {
+ "id": "msg_err_deployment_name_not_found",
+ "translation": "The {{.key}} [{{.name}}] in deployment file not found in manifest file.\n"
+ },
+ {
+ "id": "msg_err_entity_create",
+ "translation": "Error creating {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
+ },
+ {
+ "id": "msg_err_entity_delete",
+ "translation": "Error deleting {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
},
{
"id": "msg_err_feed_invoke",
"translation": "Failed to invoke the feed when deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
},
+ {
+ "id": "msg_err_key_missing_mandatory",
+ "translation": "The mandatory key [{{.key}}] is missing.\n"
+ },
+ {
+ "id": "msg_err_manifest_not_found",
+ "translation": "Manifest file not found at path [{{.path}}].\n"
+ },
+ {
+ "id": "msg_err_name_mismatch",
+ "translation": "The {{.key}} named [{{.dname}}] in deployment file [{{.dpath}}] does not match the name [{{.mname}}] in manifest file [{{.mpath}}]."
+ },
+ {
+ "id": "msg_err_runtime_invalid",
+ "translation": "Invalid or missing runtime [{{.runtime}}] specified in manifest for the action [{{.action}}].\n"
+ },
+ {
+ "id": "msg_err_runtime_mismatch",
+ "translation": "Runtime [{{.runtime}}] specified in manifest does not match with action's source file extension [{{.ext}}] for action [{{.action}}].\n"
+ },
+ {
+ "id": "msg_err_runtimes_get",
+ "translation": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n"
+ },
+ {
+ "id": "msg_err_url_invalid",
+ "translation": "Invalid or missing {{.urltype}} URL [{{.url}}] in [{{.filetype}}] file.\n"
+ },
+ {
+ "id": "msg_err_url_malformed",
+ "translation": "Malformed {{.urltype}} URL [{{.url}}]. Try again...\n"
+ },
+ {
+ "id": "msg_err_json_missing_cmd_key",
+ "translation": "JSON input data Missing 'cmd' key"
+ },
+ {
+ "id": "WARNINGS",
+ "translation": "================= WARNINGS ==================="
+ },
+ {
+ "id": "msg_warn_command_retry",
+ "translation": "Retrying [{{.cmd}}] after error: [{{.err}}]\n"
+ },
+ {
+ "id": "msg_warn_config_invalid",
+ "translation": "Invalid or missing config file [{{.path}}] detected.\n"
+ },
+ {
+ "id": "msg_warn_key_deprecated_replaced",
+ "translation": "The [{{.oldkey}}] key in the {{.filetype}} file will soon be deprecated, please use the [{{.newkey}}] key instead.\n"
+ },
+ {
+ "id": "msg_warn_key_missing",
+ "translation": "The mandatory key [{{.key}}] should be set. Using default value [{{.value}}]...\n"
+ },
+ {
+ "id": "msg_warn_key_value_invalid",
+ "translation": "The value for key [{{.key}}] is not valid.\n"
+ },
{
"id": "msg_warn_key_value_not_saved",
"translation": "The value for key [{{.key}}] is not saved in the current version of wskdeploy.\n"
},
{
- "id": "msg_warn_invalid_key_value",
- "translation": "The value for key [{{.key}}] is not valid.\n"
+ "id": "msg_warn_limit_ignored",
+ "translation": "Invalid action limit [{{.limit}}] in manifest is ignored.\n"
+ },
+ {
+ "id": "msg_warn_limit_changeable",
+ "translation": "Limit [{{.name}}] is currently not changeable. Ignoring...\n"
+ },
+ {
+ "id": "msg_warn_limits_log_size",
+ "translation": "logSize of limits in manifest should be an integer between 0 and 10.\n"
},
{
"id": "msg_warn_limits_memory_size",
@@ -246,11 +360,39 @@
"translation": "timeout of limits in manifest should be an integer between 100 and 300000.\n"
},
{
- "id": "msg_warn_limits_memory_log_size",
- "translation": "logSize of limits in manifest should be an integer between 0 and 10.\n"
+ "id": "msg_warn_whisk_properties",
+ "translation": "The [{{.key}}] key was retrieved from whisk.properties which will soon be deprecated please do not use it outside of Travis builds.\n"
},
{
- "id": "msg_warn_limit_changeable",
- "translation": "Limit [{{.name}}] is currently not changeable. Ignoring for now....\n"
+ "id": "msg_warn_value_range",
+ "translation": "The value for {{.name}} [{{.key}}] in {{.filetype}} should type {{.type}} between {{.min}} and {{.mac}}.\n"
+ },
+ {
+ "id": "msg_warn_runtime_changed",
+ "translation": "Runtime changed to [{{.runtime}}] based on the action's source file extension for action [{{.action}}].\n"
+ },
+ {
+ "id": "msg_warn_entity_name_exists",
+ "translation": "The {{.key}} name [{{.name}}] already exists. Please select another name.\n"
+ },
+ {
+ "id": "DEBUG",
+ "translation": "================= DEBUG ==================="
+ },
+ {
+ "id": "msg_dbg_key_verify",
+ "translation": "Verifying {{.name}} [{{.key}}] exists...\n"
+ },
+ {
+ "id": "msg_dbg_deploying_using",
+ "translation": "Deploying using:\n"
+ },
+ {
+ "id": "msg_dbg_undeploying_using",
+ "translation": "Undeploying using:\n"
+ },
+ {
+ "id": "msg_dbg_searching_project_directory",
+ "translation": "Searching project directory [{{.path}}] for [{{.key}}]...\n"
}
]
diff --git a/wskprint/console.go b/wskprint/console.go
index ccf66539..122eed78 100644
--- a/wskprint/console.go
+++ b/wskprint/console.go
@@ -19,7 +19,6 @@ package wskprint
import (
"fmt"
- "github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
"github.com/fatih/color"
"github.com/mattn/go-colorable"
@@ -29,14 +28,18 @@ const(
STR_PREFIXED_MESSAGE = "%s: %s"
)
+var(
+ clrInfo = color.New(color.FgCyan)
+ clrWarning = color.New(color.FgYellow)
+ clrError = color.New(color.FgRed)
+ clrSuccess = color.New(color.FgGreen)
+ clrTitleInfo = color.New(color.FgCyan).Add(color.Underline)
+)
+
func PrintOpenWhiskError(message string) {
outputStream := colorable.NewColorableStderr()
- fmsg := fmt.Sprintf( STR_PREFIXED_MESSAGE, wski18n.T(wski18n.ID_MSG_PREFIX_ERROR), message)
- fmt.Fprintf(outputStream, color.RedString(fmsg))
-}
-
-func PrintlnOpenWhiskError(message string) {
- PrintOpenWhiskError(message + "\n")
+ fmt.Fprintf(outputStream, clrError.Sprintf( STR_PREFIXED_MESSAGE,
+ wski18n.T(wski18n.ID_MSG_PREFIX_ERROR), message))
}
func PrintOpenWhiskFromError(err error) {
@@ -45,8 +48,8 @@ func PrintOpenWhiskFromError(err error) {
func PrintOpenWhiskWarning(message string) {
outputStream := colorable.NewColorableStdout()
- fmsg := fmt.Sprintf( STR_PREFIXED_MESSAGE, wski18n.T(wski18n.ID_MSG_PREFIX_WARNING), message)
- fmt.Fprintf(outputStream, color.YellowString(fmsg))
+ fmt.Fprintf(outputStream, clrWarning.Sprintf( STR_PREFIXED_MESSAGE,
+ wski18n.T(wski18n.ID_MSG_PREFIX_WARNING), message))
}
func PrintlnOpenWhiskWarning(message string) {
@@ -55,28 +58,47 @@ func PrintlnOpenWhiskWarning(message string) {
func PrintOpenWhiskSuccess(message string) {
outputStream := colorable.NewColorableStdout()
- fmsg := fmt.Sprintf( STR_PREFIXED_MESSAGE, wski18n.T(wski18n.ID_MSG_PREFIX_SUCCESS), message)
- fmt.Fprintf(outputStream, color.GreenString(fmsg))
+ fmt.Fprintf(outputStream, clrSuccess.Sprintf( STR_PREFIXED_MESSAGE,
+ wski18n.T(wski18n.ID_MSG_PREFIX_SUCCESS), message))
}
func PrintlnOpenWhiskSuccess(message string) {
PrintOpenWhiskSuccess(message + "\n")
}
-func PrintOpenWhiskStatus(message string) {
+func PrintOpenWhiskInfo(message string) {
outputStream := colorable.NewColorableStdout()
- fmsg := fmt.Sprintf( STR_PREFIXED_MESSAGE, wski18n.T(wski18n.ID_MSG_PREFIX_INFO), message)
- fmt.Fprintf(outputStream, color.CyanString(fmsg))
+ fmt.Fprintf(outputStream, clrInfo.Sprintf( STR_PREFIXED_MESSAGE,
+ wski18n.T(wski18n.ID_MSG_PREFIX_INFO), message))
+}
+
+
+func PrintlnOpenWhiskInfo(message string) {
+ PrintOpenWhiskInfo(message + "\n")
}
-func PrintlnOpenWhiskStatus(message string) {
- PrintOpenWhiskStatus(message + "\n")
+func PrintlnOpenWhiskInfoTitle(message string) {
+ outputStream := colorable.NewColorableStdout()
+ fmt.Fprintf(outputStream, clrTitleInfo.Sprintf( STR_PREFIXED_MESSAGE,
+ wski18n.T(wski18n.ID_MSG_PREFIX_INFO), message))
}
func PrintlnOpenWhiskOutput(message string) {
fmt.Println(message)
}
-func PrintOpenWhiskDebugInfo(message string) {
- whisk.Debug(whisk.DbgInfo, message)
+func PrintOpenWhiskVerboseTitle(verbose bool, message string) {
+ if verbose{
+ PrintlnOpenWhiskInfoTitle(message)
+ }
+}
+
+func PrintOpenWhiskVerbose(verbose bool, message string) {
+ if verbose{
+ PrintOpenWhiskInfo(message)
+ }
+}
+
+func PrintlnOpenWhiskVerbose(verbose bool, message string) {
+ PrintOpenWhiskVerbose(verbose, message + "\n")
}
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services