You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2018/01/11 16:10:52 UTC
[incubator-openwhisk-wskdeploy] branch master updated: Update
WhiskClient.go to use i18n IDs. (#684)
This is an automated email from the ASF dual-hosted git repository.
houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git
The following commit(s) were added to refs/heads/master by this push:
new 150171b Update WhiskClient.go to use i18n IDs. (#684)
150171b is described below
commit 150171bec1c420617a2e34be39bf45e3c18eb966
Author: Matt Rutkowski <mr...@us.ibm.com>
AuthorDate: Thu Jan 11 10:10:49 2018 -0600
Update WhiskClient.go to use i18n IDs. (#684)
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* Update WhiskClient.go to use i18n IDs.
* update
* update
* update
* udpate runtimes.go for i18n.
* udpate runtimes.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* udpate servicedeployer.go for i18n.
* Add interactive prompts into whiskclient.go for i18n.
* Add interactive prompts into whiskclient.go for i18n.
* Add interactive prompts into whiskclient.go for i18n.
* Add i18n strings for managed deployments in servicedeployer.go.
* Continue adding i18n support in servicedeployer.go.
* Continue adding i18n support in servicedeployer.go.
* Create reusable method to create/display WhiskClientErrors in servicedeployer.go.
* Create reusable method to display deploy/undeply message in servicedeployer.go.
* Create reusable method to display deploy/undeployed success message in servicedeployer.go.
* Reusable method to perform deploy/undeploy postprocessing in servicedeployer.go
---
deployers/servicedeployer.go | 437 ++++++++++++++++++++-------------------
deployers/whiskclient.go | 133 ++++++------
utils/runtimes.go | 9 +-
wskderrors/wskdeployerror.go | 4 +
wski18n/i18n_ids.go | 409 +++++++++++-------------------------
wski18n/i18n_ids_test.go | 41 ++++
wski18n/i18n_resources.go | 4 +-
wski18n/resources/en_US.all.json | 236 ++++++++-------------
8 files changed, 542 insertions(+), 731 deletions(-)
diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index 6554539..39d1579 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -27,13 +27,12 @@ import (
"strings"
"sync"
"time"
-
+ "net/http"
"github.com/apache/incubator-openwhisk-client-go/whisk"
"github.com/apache/incubator-openwhisk-wskdeploy/parsers"
"github.com/apache/incubator-openwhisk-wskdeploy/utils"
"github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
"github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
- "net/http"
"github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
)
@@ -143,14 +142,15 @@ 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 == "" {
- // TODO see if we can move string to translation file.
- return wskderrors.NewYAMLFileFormatError(manifest.Filepath, "Project name in manifest file is mandatory for managed deployments")
+ errmsg := wski18n.T(wski18n.ID_ERR_MISSING_MANDATORY_KEY_X_key_X,
+ map[string]interface{}{"key": "project name"})
+
+ return wskderrors.NewYAMLFileFormatError(manifest.Filepath, errmsg)
}
// Every OpenWhisk entity in the manifest file will be annotated with:
//managed: '{"__OW__PROJECT__NAME": <name>, "__OW__PROJECT_HASH": <hash>, "__OW__FILE": <path>}'
deployer.ManagedAnnotation, err = utils.GenerateManagedAnnotation(deployer.ProjectName, manifest.Filepath)
if err != nil {
- // TODO see if we can pass in the YAML file path on first parameter
return wskderrors.NewYAMLFileFormatError(manifest.Filepath, err.Error())
}
}
@@ -179,8 +179,8 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error {
// (TODO) delete this warning after deprecating application in manifest file
if manifest.Application.Name != "" {
- warningString := wski18n.T("WARNING: application in manifest file will soon be deprecated, please use project instead.\n")
- whisk.Debug(whisk.DbgWarn, warningString)
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED,
+ map[string]interface{}{"oldkey": "application", "newkey": "project", "filetype": "manifest"}))
}
// process deployment file
@@ -194,17 +194,21 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error {
// (TODO) delete this warning after deprecating application in deployment file
if deploymentReader.DeploymentDescriptor.Application.Name != "" {
- warningString := wski18n.T("WARNING: application in deployment file will soon be deprecated, please use project instead.\n")
- whisk.Debug(whisk.DbgWarn, warningString)
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED,
+ map[string]interface{}{"oldkey": "application", "newkey": "project", "filetype": "deployment"}))
}
- // compare the name of the project/application
+ // 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("The name of the project/application {{.projectNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the project/application {{.projectNameManifest}}} in manifest file at [{{.manifestFile}}].",
- map[string]interface{}{"projectNameDeploy": projectNameDeploy, "deploymentFile": deployer.DeploymentPath,
- "projectNameManifest": projectName, "manifestFile": deployer.ManifestPath})
+ errorString := wski18n.T(wski18n.ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X,
+ map[string]interface{}{
+ "key": "project",
+ "dname": projectNameDeploy,
+ "dpath": deployer.DeploymentPath,
+ "mname": projectName,
+ "mpath": deployer.ManifestPath})
return wskderrors.NewYAMLFileFormatError(manifest.Filepath, errorString)
}
}
@@ -257,8 +261,8 @@ func (deployer *ServiceDeployer) ConstructUnDeploymentPlan() (*DeploymentProject
// (TODO) delete this warning after deprecating application in manifest file
if manifest.Application.Name != "" {
- warningString := wski18n.T("WARNING: application in manifest file will soon be deprecated, please use project instead.\n")
- whisk.Debug(whisk.DbgWarn, warningString)
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED,
+ map[string]interface{}{"oldkey": "application", "newkey": "project", "filetype": "manifest"}))
}
// process deployment file
@@ -271,16 +275,21 @@ func (deployer *ServiceDeployer) ConstructUnDeploymentPlan() (*DeploymentProject
// (TODO) delete this warning after deprecating application in deployment file
if deploymentReader.DeploymentDescriptor.Application.Name != "" {
- warningString := wski18n.T("WARNING: application in deployment file will soon be deprecated, please use project instead.\n")
- whisk.Debug(whisk.DbgWarn, warningString)
+ wskprint.PrintOpenWhiskWarning(wski18n.T(wski18n.ID_WARN_DEPRECATED_KEY_REPLACED,
+ map[string]interface{}{"oldkey": "application", "newkey": "project", "filetype": "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("The name of the project/application {{.projectNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the application {{.projectNameManifest}}} in manifest file at [{{.manifestFile}}].",
- map[string]interface{}{"projectNameDeploy": projectNameDeploy, "deploymentFile": deployer.DeploymentPath,
- "projectNameManifest": projectName, "manifestFile": deployer.ManifestPath})
+ errorString := wski18n.T(wski18n.ID_ERR_MISMATCH_NAME_X_key_X_dname_X_dpath_X_mname_X_moath_X,
+ map[string]interface{}{
+ "key": "project",
+ "dname": projectNameDeploy,
+ "dpath": deployer.DeploymentPath,
+ "mname": projectName,
+ "mpath": deployer.ManifestPath})
return deployer.Deployment, wskderrors.NewYAMLFileFormatError(manifest.Filepath, errorString)
}
}
@@ -301,9 +310,10 @@ func (deployer *ServiceDeployer) Deploy() error {
if deployer.IsInteractive == true {
deployer.printDeploymentAssets(deployer.Deployment)
- reader := bufio.NewReader(os.Stdin)
- fmt.Print("Do you really want to deploy this? (y/N): ")
+ // TODO() See if we can use the promptForValue() function in whiskclient.go
+ reader := bufio.NewReader(os.Stdin)
+ fmt.Print(wski18n.T(wski18n.ID_MSG_PROMPT_DEPLOY))
text, _ := reader.ReadString('\n')
text = strings.TrimSpace(text)
@@ -311,32 +321,34 @@ func (deployer *ServiceDeployer) Deploy() error {
text = "n"
}
+ // TODO() make possible responses constants (enum?) and create "No" corallary
if strings.EqualFold(text, "y") || strings.EqualFold(text, "yes") {
deployer.InteractiveChoice = true
if err := deployer.deployAssets(); err != nil {
- errString := wski18n.T("Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n")
- whisk.Debug(whisk.DbgError, errString)
+ wskprint.PrintOpenWhiskError(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_FAILED))
return err
}
- wskprint.PrintOpenWhiskSuccess(wski18n.T("Deployment completed successfully.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_SUCCEEDED))
return nil
} else {
+ // TODO() Should acknowledge if user typed (No/N/n) and if not still exit, but
+ // indicate we took the response to mean "No", typically by displaying interpolated
+ // response in parenthesis
deployer.InteractiveChoice = false
- wskprint.PrintOpenWhiskSuccess(wski18n.T("OK. Cancelling deployment.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_CANCELLED))
return nil
}
}
// non-interactive
if err := deployer.deployAssets(); err != nil {
- errString := wski18n.T("Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n")
- whisk.Debug(whisk.DbgError, errString)
+ wskprint.PrintOpenWhiskError(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_FAILED))
return err
}
- wskprint.PrintOpenWhiskSuccess(wski18n.T("Deployment completed successfully.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_SUCCEEDED)))
return nil
}
@@ -377,7 +389,7 @@ func (deployer *ServiceDeployer) deployAssets() error {
// from the manifest file must result in undeployment of those deleted entities
if utils.Flags.Managed {
if err := deployer.RefreshManagedEntities(deployer.ManagedAnnotation); err != nil {
- errString := wski18n.T("Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n")
+ errString := wski18n.T(wski18n.ID_MSG_MANAGED_UNDEPLOYMENT_FAILED)
whisk.Debug(whisk.DbgError, errString)
return err
}
@@ -389,8 +401,8 @@ func (deployer *ServiceDeployer) deployAssets() error {
func (deployer *ServiceDeployer) DeployDependencies() error {
for _, pack := range deployer.Deployment.Packages {
for depName, depRecord := range pack.Dependencies {
- output := wski18n.T("Deploying dependency {{.output}} ...",
- map[string]interface{}{"output": depName})
+ output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYING_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgInfo, output)
if depRecord.IsBinding {
@@ -413,8 +425,8 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
if error != nil {
return error
} else {
- output := wski18n.T("Dependency {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": depName})
+ output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgInfo, output)
}
@@ -430,8 +442,8 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
}
if err := depServiceDeployer.deployAssets(); err != nil {
- errString := wski18n.T("Deployment of dependency {{.depName}} did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n",
- map[string]interface{}{"depName": depName})
+ errString := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_FAILURE_X_name_X,
+ map[string]interface{}{"name": depName})
wskprint.PrintOpenWhiskError(errString)
return err
}
@@ -459,8 +471,8 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
if err != nil {
return err
} else {
- output := wski18n.T("Dependency {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": depName})
+ output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_DEPLOYMENT_SUCCESS_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgInfo, output)
}
}
@@ -471,6 +483,7 @@ func (deployer *ServiceDeployer) DeployDependencies() error {
return nil
}
+// TODO() display "update" | "synced" messages pre/post
func (deployer *ServiceDeployer) RefreshManagedEntities(maValue whisk.KeyValue) error {
ma := maValue.Value.(map[string]interface{})
@@ -489,6 +502,8 @@ func (deployer *ServiceDeployer) RefreshManagedEntities(maValue whisk.KeyValue)
return nil
}
+
+// TODO() display "update" | "synced" messages pre/post
func (deployer *ServiceDeployer) RefreshManagedActions(packageName string, ma map[string]interface{}) error {
options := whisk.ActionListOptions{}
// get a list of actions in your namespace
@@ -512,10 +527,14 @@ func (deployer *ServiceDeployer) RefreshManagedActions(packageName string, ma ma
// that this action is deleted from the project in manifest file
if aa[utils.OW_PROJECT_NAME] == ma[utils.OW_PROJECT_NAME] && aa[utils.OW_PROJECT_HASH] != ma[utils.OW_PROJECT_HASH] {
actionName := strings.Join([]string{packageName, action.Name}, "/")
- output := wski18n.T("Found the action {{.action}} which is deleted"+
- " from the current project {{.project}} in manifest file which is being undeployed.\n",
- map[string]interface{}{"action": actionName, "project": aa[utils.OW_PROJECT_NAME]})
- whisk.Debug(whisk.DbgInfo, output)
+
+ output := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
+ map[string]interface{}{
+ "key": "action",
+ "name": actionName,
+ "project": aa[utils.OW_PROJECT_NAME]})
+ wskprint.PrintOpenWhiskWarning(output)
+
var err error
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
_, err := deployer.Client.Actions.Delete(actionName)
@@ -531,6 +550,7 @@ func (deployer *ServiceDeployer) RefreshManagedActions(packageName string, ma ma
return nil
}
+// TODO() display "update" | "synced" messages pre/post
func (deployer *ServiceDeployer) RefreshManagedTriggers(ma map[string]interface{}) error {
options := whisk.TriggerListOptions{}
// Get list of triggers in your namespace
@@ -549,10 +569,13 @@ func (deployer *ServiceDeployer) RefreshManagedTriggers(ma map[string]interface{
ta := a.(map[string]interface{})
if ta[utils.OW_PROJECT_NAME] == ma[utils.OW_PROJECT_NAME] && ta[utils.OW_PROJECT_HASH] != ma[utils.OW_PROJECT_HASH] {
// we have found a trigger which was earlier part of the current project
- output := wski18n.T("Found the trigger {{.trigger}} which is deleted"+
- " from the current project {{.project}} in manifest file which is being undeployed.\n",
- map[string]interface{}{"trigger": trigger.Name, "project": ma[utils.OW_PROJECT_NAME]})
- whisk.Debug(whisk.DbgInfo, output)
+ output := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
+ map[string]interface{}{
+ "key": "trigger",
+ "name": trigger.Name,
+ "project": ma[utils.OW_PROJECT_NAME]})
+ wskprint.PrintOpenWhiskWarning(output)
+
var err error
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
_, _, err := deployer.Client.Triggers.Delete(trigger.Name)
@@ -568,10 +591,13 @@ func (deployer *ServiceDeployer) RefreshManagedTriggers(ma map[string]interface{
return nil
}
+// TODO() engage community to allow metadata (annotations) on Rules
+// TODO() display "update" | "synced" messages pre/post
func (deployer *ServiceDeployer) RefreshManagedRules(ma map[string]interface{}) error {
return nil
}
+// TODO() display "update" | "synced" messages pre/post
func (deployer *ServiceDeployer) RefreshManagedPackages(ma map[string]interface{}) error {
options := whisk.PackageListOptions{}
// Get the list of packages in your namespace
@@ -595,10 +621,13 @@ func (deployer *ServiceDeployer) RefreshManagedPackages(ma map[string]interface{
}
// we have found a package which was earlier part of the current project
if pa[utils.OW_PROJECT_NAME] == ma[utils.OW_PROJECT_NAME] && pa[utils.OW_PROJECT_HASH] != ma[utils.OW_PROJECT_HASH] {
- output := wski18n.T("Found the package {{.package}} which is deleted"+
- " from the current project {{.project}} in manifest file which is being undeployed.\n",
- map[string]interface{}{"package": pkg.Name, "project": pa[utils.OW_PROJECT_NAME]})
- whisk.Debug(whisk.DbgInfo, output)
+ output := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,
+ map[string]interface{}{
+ "key": "package",
+ "name": pkg.Name,
+ "project": pa[utils.OW_PROJECT_NAME]})
+ wskprint.PrintOpenWhiskWarning(output)
+
var err error
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
_, err := deployer.Client.Packages.Delete(pkg.Name)
@@ -629,9 +658,9 @@ func (deployer *ServiceDeployer) DeploySequences() error {
for _, pack := range deployer.Deployment.Packages {
for _, action := range pack.Sequences {
- error := deployer.createAction(pack.Package.Name, action.Action)
- if error != nil {
- return error
+ err := deployer.createAction(pack.Package.Name, action.Action)
+ if err != nil {
+ return err
}
}
}
@@ -657,14 +686,14 @@ func (deployer *ServiceDeployer) DeployTriggers() error {
for _, trigger := range deployer.Deployment.Triggers {
if feedname, isFeed := utils.IsFeedAction(trigger); isFeed {
- error := deployer.createFeedAction(trigger, feedname)
- if error != nil {
- return error
+ err := deployer.createFeedAction(trigger, feedname)
+ if err != nil {
+ return err
}
} else {
- error := deployer.createTrigger(trigger)
- if error != nil {
- return error
+ err := deployer.createTrigger(trigger)
+ if err != nil {
+ return err
}
}
@@ -676,9 +705,9 @@ func (deployer *ServiceDeployer) DeployTriggers() error {
// Deploy Rules into OpenWhisk
func (deployer *ServiceDeployer) DeployRules() error {
for _, rule := range deployer.Deployment.Rules {
- error := deployer.createRule(rule)
- if error != nil {
- return error
+ err := deployer.createRule(rule)
+ if err != nil {
+ return err
}
}
return nil
@@ -687,20 +716,19 @@ func (deployer *ServiceDeployer) DeployRules() error {
// Deploy Apis into OpenWhisk
func (deployer *ServiceDeployer) DeployApis() error {
for _, api := range deployer.Deployment.Apis {
- error := deployer.createApi(api)
- if error != nil {
- return error
+ err := deployer.createApi(api)
+ if err != nil {
+ return err
}
}
return nil
}
func (deployer *ServiceDeployer) createBinding(packa *whisk.BindingPackage) error {
- output := wski18n.T("Deploying package binding {{.output}} ...",
- map[string]interface{}{"output": packa.Name})
- whisk.Debug(whisk.DbgInfo, output)
- var err error
+ displayPreprocessingInfo("package binding", packa.Name, true)
+
+ var err error
var response *http.Response
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
_, response, err = deployer.Client.Packages.Insert(packa, true)
@@ -708,23 +736,17 @@ func (deployer *ServiceDeployer) createBinding(packa *whisk.BindingPackage) erro
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating package binding with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
- } else {
- output := wski18n.T("Package binding {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": packa.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ return createWhiskClientError(err.(*whisk.WskError), response, "package binding", true)
}
+
+ displayPostprocessingInfo("package binding", packa.Name, true)
return nil
}
func (deployer *ServiceDeployer) createPackage(packa *whisk.Package) error {
- output := wski18n.T("Deploying package {{.output}} ...",
- map[string]interface{}{"output": packa.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("package", packa.Name, true)
+
var err error
var response *http.Response
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
@@ -732,23 +754,17 @@ func (deployer *ServiceDeployer) createPackage(packa *whisk.Package) error {
return err
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating package with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
- } else {
- output := wski18n.T("Package {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": packa.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ return createWhiskClientError(err.(*whisk.WskError), response, "package", true)
}
+
+ displayPostprocessingInfo("package", packa.Name, true)
return nil
}
func (deployer *ServiceDeployer) createTrigger(trigger *whisk.Trigger) error {
- output := wski18n.T("Deploying trigger {{.output}} ...",
- map[string]interface{}{"output": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("trigger", trigger.Name, true)
+
var err error
var response *http.Response
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
@@ -756,23 +772,17 @@ func (deployer *ServiceDeployer) createTrigger(trigger *whisk.Trigger) error {
return err
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
- } else {
- output := wski18n.T("Trigger {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ return createWhiskClientError(err.(*whisk.WskError), response, "trigger", true)
}
+
+ displayPostprocessingInfo("trigger", trigger.Name, true)
return nil
}
func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedName string) error {
- output := wski18n.T("Deploying trigger feed {{.output}} ...",
- map[string]interface{}{"output": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("trigger feed", trigger.Name, true)
+
// to hold and modify trigger parameters, not passed by ref?
params := make(map[string]interface{})
@@ -811,11 +821,7 @@ func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedNa
return err
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "trigger feed", true)
} else {
qName, err := utils.ParseQualifiedName(feedName, deployer.ClientConfig.Namespace)
@@ -840,20 +846,17 @@ func (deployer *ServiceDeployer) createFeedAction(trigger *whisk.Trigger, feedNa
return err
})
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "trigger feed", false)
}
}
- output = wski18n.T("Trigger feed {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPostprocessingInfo("trigger feed", trigger.Name, true)
return nil
}
func (deployer *ServiceDeployer) createRule(rule *whisk.Rule) error {
+ displayPreprocessingInfo("rule", rule.Name, true)
+
// The rule's trigger should include the namespace with pattern /namespace/trigger
rule.Trigger = deployer.getQualifiedName(rule.Trigger.(string), deployer.ClientConfig.Namespace)
// The rule's action should include the namespace and package
@@ -867,9 +870,6 @@ func (deployer *ServiceDeployer) createRule(rule *whisk.Rule) error {
// if not, we assume the action is inside the root package
rule.Action = deployer.getQualifiedName(strings.Join([]string{deployer.RootPackageName, rule.Action.(string)}, "/"), deployer.ClientConfig.Namespace)
}
- output := wski18n.T("Deploying rule {{.output}} ...",
- map[string]interface{}{"output": rule.Name})
- whisk.Debug(whisk.DbgInfo, output)
var err error
var response *http.Response
@@ -879,16 +879,10 @@ func (deployer *ServiceDeployer) createRule(rule *whisk.Rule) error {
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating rule with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "rule", true)
}
- output = wski18n.T("Rule {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": rule.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ displayPostprocessingInfo("rule", rule.Name, true)
return nil
}
@@ -899,9 +893,8 @@ func (deployer *ServiceDeployer) createAction(pkgname string, action *whisk.Acti
// the action will be created under package with pattern 'packagename/actionname'
action.Name = strings.Join([]string{pkgname, action.Name}, "/")
}
- output := wski18n.T("Deploying action {{.output}} ...",
- map[string]interface{}{"output": action.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("action", action.Name, true)
var err error
var response *http.Response
@@ -911,45 +904,42 @@ func (deployer *ServiceDeployer) createAction(pkgname string, action *whisk.Acti
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating action with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
- } else {
- output := wski18n.T("Action {{.output}} has been successfully deployed.\n",
- map[string]interface{}{"output": action.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ return createWhiskClientError(err.(*whisk.WskError), response, "action", true)
}
+
+ displayPostprocessingInfo("action", action.Name, true)
return nil
}
// create api (API Gateway functionality)
func (deployer *ServiceDeployer) createApi(api *whisk.ApiCreateRequest) error {
+
+ displayPreprocessingInfo("api", api.ApiDoc.ApiName, true)
+
var err error
var response *http.Response
+
+ // TODO() Is there an api delete function? could not find it
err = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {
_, response, err = deployer.Client.Apis.Insert(api, nil, true)
return err
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error creating api with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "api", true)
}
+
+ displayPostprocessingInfo("api", api.ApiDoc.ApiName, true)
return nil
}
func (deployer *ServiceDeployer) UnDeploy(verifiedPlan *DeploymentProject) error {
if deployer.IsInteractive == true {
deployer.printDeploymentAssets(verifiedPlan)
- reader := bufio.NewReader(os.Stdin)
-
- fmt.Print("Do you really want to undeploy this? (y/N): ")
+ // TODO() See if we can use the promptForValue() function in whiskclient.go
+ reader := bufio.NewReader(os.Stdin)
+ fmt.Print(wski18n.T(wski18n.ID_MSG_PROMPT_UNDEPLOY))
text, _ := reader.ReadString('\n')
text = strings.TrimSpace(text)
@@ -957,34 +947,33 @@ func (deployer *ServiceDeployer) UnDeploy(verifiedPlan *DeploymentProject) error
text = "n"
}
+ // TODO() Use constants for possible return values y/N/yes/No etc.
if strings.EqualFold(text, "y") || strings.EqualFold(text, "yes") {
deployer.InteractiveChoice = true
if err := deployer.unDeployAssets(verifiedPlan); err != nil {
- wskprint.PrintOpenWhiskError(wski18n.T("Undeployment did not complete sucessfully.\n"))
+ wskprint.PrintOpenWhiskError(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_FAILED)))
return err
}
- wskprint.PrintOpenWhiskSuccess(wski18n.T("Deployment removed successfully.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_SUCCEEDED)))
return nil
} else {
deployer.InteractiveChoice = false
- wskprint.PrintOpenWhiskSuccess(wski18n.T("OK. Canceling undeployment.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_CANCELLED)))
return nil
}
}
// non-interactive
if err := deployer.unDeployAssets(verifiedPlan); err != nil {
- errString := wski18n.T("Undeployment did not complete sucessfully.\n")
- whisk.Debug(whisk.DbgError, errString)
+ wskprint.PrintOpenWhiskError(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_FAILED)))
return err
}
- wskprint.PrintOpenWhiskSuccess(wski18n.T("Deployment removed successfully.\n"))
+ wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_SUCCEEDED)))
return nil
-
}
func (deployer *ServiceDeployer) unDeployAssets(verifiedPlan *DeploymentProject) error {
@@ -1014,14 +1003,13 @@ func (deployer *ServiceDeployer) unDeployAssets(verifiedPlan *DeploymentProject)
}
return nil
-
}
func (deployer *ServiceDeployer) UnDeployDependencies() error {
for _, pack := range deployer.Deployment.Packages {
for depName, depRecord := range pack.Dependencies {
- output := wski18n.T("Undeploying dependency {{.depName}} ...",
- map[string]interface{}{"depName": depName})
+ output := wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYING_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgInfo, output)
if depRecord.IsBinding {
@@ -1055,24 +1043,20 @@ func (deployer *ServiceDeployer) UnDeployDependencies() error {
return err
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting binding package with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "package binding", false)
}
}
}
if err := depServiceDeployer.unDeployAssets(plan); err != nil {
- errString := wski18n.T("Undeployment of dependency {{.depName}} did not complete sucessfully.\n",
- map[string]interface{}{"depName": depName})
+ errString := wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYMENT_FAILURE_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgError, errString)
return err
}
}
- output = wski18n.T("Dependency {{.depName}} has been successfully undeployed.\n",
- map[string]interface{}{"depName": depName})
+ output = wski18n.T(wski18n.ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X,
+ map[string]interface{}{"name": depName})
whisk.Debug(whisk.DbgInfo, output)
}
}
@@ -1151,9 +1135,9 @@ func (deployer *ServiceDeployer) UnDeployRules(deployment *DeploymentProject) er
}
func (deployer *ServiceDeployer) deletePackage(packa *whisk.Package) error {
- output := wski18n.T("Removing package {{.package}} ...",
- map[string]interface{}{"package": packa.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("package", packa.Name, false)
+
if _, _, ok := deployer.Client.Packages.Get(packa.Name); ok == nil {
var err error
var response *http.Response
@@ -1163,20 +1147,16 @@ func (deployer *ServiceDeployer) deletePackage(packa *whisk.Package) error {
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting package with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "package", false)
}
}
+ displayPostprocessingInfo("package", packa.Name, false)
return nil
}
func (deployer *ServiceDeployer) deleteTrigger(trigger *whisk.Trigger) error {
- output := wski18n.T("Removing trigger {{.trigger}} ...",
- map[string]interface{}{"trigger": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("trigger", trigger.Name, false)
var err error
var response *http.Response
@@ -1186,16 +1166,10 @@ func (deployer *ServiceDeployer) deleteTrigger(trigger *whisk.Trigger) error {
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
- } else {
- output := wski18n.T("Trigger {{.trigger}} has been removed.\n",
- map[string]interface{}{"trigger": trigger.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ return createWhiskClientError(err.(*whisk.WskError), response, "trigger", false)
}
+
+ displayPostprocessingInfo("trigger", trigger.Name, false)
return nil
}
@@ -1242,11 +1216,7 @@ func (deployer *ServiceDeployer) deleteFeedAction(trigger *whisk.Trigger, feedNa
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "trigger", false)
}
}
@@ -1254,9 +1224,8 @@ func (deployer *ServiceDeployer) deleteFeedAction(trigger *whisk.Trigger, feedNa
}
func (deployer *ServiceDeployer) deleteRule(rule *whisk.Rule) error {
- output := wski18n.T("Removing rule {{.rule}} ...",
- map[string]interface{}{"rule": rule.Name})
- whisk.Debug(whisk.DbgInfo, output)
+
+ displayPreprocessingInfo("rule", rule.Name, false)
var err error
var response *http.Response
@@ -1266,29 +1235,21 @@ func (deployer *ServiceDeployer) deleteRule(rule *whisk.Rule) error {
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting rule with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "rule", false)
}
- output = wski18n.T("Rule {{.rule}} has been removed.\n",
- map[string]interface{}{"rule": rule.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ displayPostprocessingInfo("rule", rule.Name, false)
return nil
}
// Utility function to call go-whisk framework to make action
func (deployer *ServiceDeployer) deleteAction(pkgname string, action *whisk.Action) error {
- // call ActionService Thru Client
+ // call ActionService through Client
if deployer.DeployActionInPackage {
// the action will be deleted under package with pattern 'packagename/actionname'
action.Name = strings.Join([]string{pkgname, action.Name}, "/")
}
- output := wski18n.T("Removing action {{.action}} ...",
- map[string]interface{}{"action": action.Name})
- whisk.Debug(whisk.DbgInfo, output)
+ displayPreprocessingInfo("action", action.Name, false)
if _, _, ok := deployer.Client.Actions.Get(action.Name); ok == nil {
var err error
@@ -1299,17 +1260,11 @@ func (deployer *ServiceDeployer) deleteAction(pkgname string, action *whisk.Acti
})
if err != nil {
- wskErr := err.(*whisk.WskError)
- errString := wski18n.T("Got error deleting action with error message: {{.err}} and error code: {{.code}}.\n",
- map[string]interface{}{"err": wskErr.Error(), "code": strconv.Itoa(wskErr.ExitCode)})
- whisk.Debug(whisk.DbgError, errString)
- return wskderrors.NewWhiskClientError(wskErr.Error(), wskErr.ExitCode, response)
+ return createWhiskClientError(err.(*whisk.WskError), response, "action", false)
}
- output = wski18n.T("Action {{.action}} has been removed.\n",
- map[string]interface{}{"action": action.Name})
- whisk.Debug(whisk.DbgInfo, output)
}
+ displayPostprocessingInfo("action", action.Name, false)
return nil
}
@@ -1324,6 +1279,7 @@ 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)
} else {
return err
@@ -1478,3 +1434,52 @@ func (deployer *ServiceDeployer) getDependentDeployer(depName string, depRecord
return depServiceDeployer, nil
}
+
+func displayPreprocessingInfo(entity string, name string, onDeploy bool){
+
+ var msgKey string
+ if onDeploy{
+ msgKey = wski18n.ID_MSG_ENTITY_DEPLOYING_X_key_X_name_X
+ } else {
+ msgKey = wski18n.ID_MSG_ENTITY_UNDEPLOYING_X_key_X_name_X
+ }
+ msg := wski18n.T(msgKey,
+ map[string]interface{}{
+ "key": entity,
+ "name": name})
+ whisk.Debug(whisk.DbgInfo, msg)
+}
+
+func displayPostprocessingInfo(entity string, name string, onDeploy bool){
+
+ var msgKey string
+ if onDeploy{
+ msgKey = wski18n.ID_MSG_ENTITY_DEPLOYED_SUCCESS_X_key_X_name_X
+ } else {
+ msgKey = wski18n.ID_MSG_ENTITY_UNDEPLOYED_SUCCESS_X_key_X_name_X
+ }
+ errString := wski18n.T(msgKey,
+ map[string]interface{}{
+ "key": entity,
+ "name": name})
+ whisk.Debug(whisk.DbgInfo, errString)
+}
+
+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
+ } else {
+ msgKey = wski18n.ID_ERR_DELETE_ENTITY_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)
+
+ // TODO() add errString as an AppendDetail() to WhiskClientError
+ return wskderrors.NewWhiskClientError(err.Error(), err.ExitCode, response)
+}
diff --git a/deployers/whiskclient.go b/deployers/whiskclient.go
index c5a5df5..64dba3d 100644
--- a/deployers/whiskclient.go
+++ b/deployers/whiskclient.go
@@ -30,16 +30,16 @@ import (
"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/wskderrors"
"github.com/apache/incubator-openwhisk-wskdeploy/wskprint"
+ "github.com/apache/incubator-openwhisk-wskdeploy/wskderrors"
)
const (
- COMMANDLINE = "wskdeploy command line"
+ COMMANDLINE = "wskdeploy command line"
DEFAULTVALUE = "default value"
- WSKPROPS = ".wskprops"
+ WSKPROPS = ".wskprops"
WHISKPROPERTY = "whisk.properties"
- INTERINPUT = "interactve input"
+ INTERINPUT = "interactve input"
)
type PropertyValue struct {
@@ -67,7 +67,7 @@ var GetCommandLineFlags = func() (string, string, string, string, string) {
return utils.Flags.ApiHost, utils.Flags.Auth, utils.Flags.Namespace, utils.Flags.Key, utils.Flags.Cert
}
-var CreateNewClient = func (config_input *whisk.Config) (*whisk.Client, error) {
+var CreateNewClient = func(config_input *whisk.Config) (*whisk.Client, error) {
var netClient = &http.Client{
Timeout: time.Second * utils.DEFAULT_HTTP_TIMEOUT,
}
@@ -85,16 +85,16 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
credential := PropertyValue{}
namespace := PropertyValue{}
apiHost := PropertyValue{}
- key := PropertyValue{}
- cert := PropertyValue{}
+ key := PropertyValue{}
+ cert := PropertyValue{}
// 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)
+ key = GetPropertyValue(key, keyfile, COMMANDLINE)
+ cert = GetPropertyValue(cert, certfile, COMMANDLINE)
// 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 {
@@ -138,29 +138,33 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
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)
+ key = GetPropertyValue(key, wskprops.Key, WSKPROPS)
+ cert = GetPropertyValue(cert, wskprops.Cert, 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
+
credential = GetPropertyValue(credential, whiskproperty.AuthKey, WHISKPROPERTY)
if credential.Source == WHISKPROPERTY {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskWarning("The authentication key was retrieved from whisk.properties " +
- "which will soon be deprecated please do not use it outside of Travis builds.")
+ warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{"key": "authenticaton key"})
+ wskprint.PrintlnOpenWhiskWarning(warnmsg)
}
namespace = GetPropertyValue(namespace, whiskproperty.Namespace, WHISKPROPERTY)
if namespace.Source == WHISKPROPERTY {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskWarning("The namespace was retrieved from whisk.properties " +
- "which will soon be deprecated please do not use it outside of Travis builds.")
+ warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{"key": "namespace"})
+ wskprint.PrintlnOpenWhiskWarning(warnmsg)
}
apiHost = GetPropertyValue(apiHost, whiskproperty.APIHost, WHISKPROPERTY)
if apiHost.Source == WHISKPROPERTY {
- // TODO() i18n
- wskprint.PrintlnOpenWhiskWarning("The API host was retrieved from whisk.properties " +
- "which will soon be deprecated please do not use it outside of Travis builds.")
+ warnmsg = wski18n.T(wski18n.ID_WARN_WHISK_PROPS_DEPRECATED,
+ map[string]interface{}{"key": "API host"})
+ wskprint.PrintlnOpenWhiskWarning(warnmsg)
}
// set namespace to default namespace if not yet found
@@ -169,14 +173,15 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
namespace.Source = DEFAULTVALUE
}
+ // TODO() See if we can split off the interactive logic into a separate function
// If we still can not find the values we need, check if it is interactive mode.
// If so, we prompt users for the input.
// The namespace is set to a default value at this point if not provided.
if len(apiHost.Value) == 0 && isInteractive == true {
- // TODO() i18n
- host := promptForValue("\nPlease provide the hostname for OpenWhisk [default value is openwhisk.ng.bluemix.net]: ")
+ host := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_APIHOST))
if host == "" {
- // TODO() tell caller that we are using this default, look to make a const at top of file
+ // TODO() programmatically tell caller that we are using this default
+ // TODO() make this configurable or remove
host = "openwhisk.ng.bluemix.net"
}
apiHost.Value = host
@@ -184,83 +189,83 @@ func NewWhiskConfig(proppath string, deploymentPath string, manifestPath string,
}
if len(credential.Value) == 0 && isInteractive == true {
- // TODO() i18n
- cred := promptForValue("\nPlease provide an authentication token: ")
+ cred := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_AUTHKEY))
credential.Value = cred
credential.Source = INTERINPUT
// 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 {
- // TODO() i18n
- ns := promptForValue("\nPlease provide a namespace [default value is guest]: ")
+ tempNamespace := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_NAMESPACE))
source := INTERINPUT
- if ns == "" {
- ns = whisk.DEFAULT_NAMESPACE
+ if tempNamespace == "" {
+ tempNamespace = whisk.DEFAULT_NAMESPACE
source = DEFAULTVALUE
}
- namespace.Value = ns
+ namespace.Value = tempNamespace
namespace.Source = source
}
}
- mode := true
- if (len(cert.Value) != 0 && len(key.Value) != 0) {
- mode = false
- }
+ mode := true
+ if (len(cert.Value) != 0 && len(key.Value) != 0) {
+ mode = false
+ }
- clientConfig = &whisk.Config {
+ clientConfig = &whisk.Config{
AuthToken: credential.Value, //Authtoken
- Namespace: namespace.Value, //Namespace
+ Namespace: namespace.Value, //Namespace
Host: apiHost.Value,
Version: "v1",
- Cert: cert.Value,
- Key: key.Value,
+ Cert: cert.Value,
+ Key: key.Value,
Insecure: mode, // true if you want to ignore certificate signing
}
+ // validate we have credential, apihost and namespace
+ err := validateClientConfig(credential, apiHost, namespace)
+
+ return clientConfig, err
+}
+
+func validateClientConfig(credential PropertyValue, apiHost PropertyValue, namespace PropertyValue) (error) {
+
+ // Display error message based upon which config value was missing
if len(credential.Value) == 0 || len(apiHost.Value) == 0 || len(namespace.Value) == 0 {
- var errStr string
+ var errmsg string
if len(credential.Value) == 0 {
- errStr += wski18n.T("The authentication key is not configured.\n")
- } else {
- errStr += wski18n.T("The authenitcation key is set from {{.authsource}}.\n",
- map[string]interface{}{"authsource": credential.Source})
+ errmsg = wski18n.T(wski18n.ID_MSG_CONFIG_MISSING_AUTHKEY)
}
if len(apiHost.Value) == 0 {
- errStr += wski18n.T("The API host is not configured.\n")
- } else {
- errStr += wski18n.T("The API host is {{.apihost}}, from {{.apisource}}.\n",
- map[string]interface{}{"apihost": apiHost.Value, "apisource": apiHost.Source})
+ errmsg = wski18n.T(wski18n.ID_MSG_CONFIG_MISSING_APIHOST)
}
if len(namespace.Value) == 0 {
- errStr += wski18n.T("The namespace is not configured.\n")
- } else {
- errStr += wski18n.T("The namespace is {{.namespace}}, from {{.namespacesource}}.\n",
- map[string]interface{}{"namespace": namespace.Value, "namespacesource": namespace.Source})
-
+ errmsg = wski18n.T(wski18n.ID_MSG_CONFIG_MISSING_NAMESPACE)
}
- whisk.Debug(whisk.DbgError, errStr)
- return clientConfig, wskderrors.NewWhiskClientInvalidConfigError(errStr)
+
+ return wskderrors.NewWhiskClientInvalidConfigError(errmsg)
}
- stdout := wski18n.T("The API host is {{.apihost}}, from {{.apisource}}.\n",
- map[string]interface{}{"apihost": apiHost.Value, "apisource": apiHost.Source})
- whisk.Debug(whisk.DbgInfo, stdout)
+ // 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)
+
+ stdout = wski18n.T(wski18n.ID_MSG_CONFIG_INFO_AUTHKEY_X_source_X,
+ map[string]interface{}{"source": credential.Source})
+ wskprint.PrintOpenWhiskStatus(stdout)
- stdout = wski18n.T("The auth key is set, from {{.authsource}}.\n",
- map[string]interface{}{"authsource": credential.Source})
- whisk.Debug(whisk.DbgInfo, 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)
- stdout = wski18n.T("The namespace is {{.namespace}}, from {{.namespacesource}}.\n",
- map[string]interface{}{"namespace": namespace.Value, "namespacesource": namespace.Source})
- whisk.Debug(whisk.DbgInfo, stdout)
- return clientConfig, nil
+ return nil
}
+// TODO() 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/utils/runtimes.go b/utils/runtimes.go
index e39d027..bacc54d 100644
--- a/utils/runtimes.go
+++ b/utils/runtimes.go
@@ -74,6 +74,7 @@ var DefaultRunTimes map[string]string
// `curl -k https://openwhisk.ng.bluemix.net`
// hard coding it here in case of network unavailable or failure.
func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
+ // TODO() create HTTP header constants and use them
ct := "application/json; charset=UTF-8"
req, _ := http.NewRequest("GET", "https://"+apiHost, nil)
req.Header.Set("Content-Type", ct)
@@ -92,7 +93,8 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
res, err := netClient.Do(req)
if err != nil {
- errString := wski18n.T("Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n",
+ // TODO() create an error
+ errString := wski18n.T(wski18n.ID_ERR_GET_RUNTIMES_X_err_X,
map[string]interface{}{"err": err.Error()})
whisk.Debug(whisk.DbgWarn, errString)
}
@@ -102,14 +104,15 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
}
// Local openwhisk deployment sometimes only returns "application/json" as the content type
+ // TODO() create HTTP header constants and use them
if err != nil || !strings.Contains(ct, res.Header.Get("Content-Type")) {
- stdout := wski18n.T("Start to unmarshal Openwhisk info from local values.\n")
+ stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_LOCAL)
whisk.Debug(whisk.DbgInfo, stdout)
err = json.Unmarshal(RUNTIME_DETAILS, &op)
} else {
b, _ := ioutil.ReadAll(res.Body)
if b != nil && len(b) > 0 {
- stdout := wski18n.T("Unmarshal Openwhisk info from internet.\n")
+ stdout := wski18n.T(wski18n.ID_MSG_UNMARSHAL_NETWORK)
whisk.Debug(whisk.DbgInfo, stdout)
err = json.Unmarshal(b, &op)
}
diff --git a/wskderrors/wskdeployerror.go b/wskderrors/wskdeployerror.go
index 461b356..c7d5e83 100644
--- a/wskderrors/wskdeployerror.go
+++ b/wskderrors/wskdeployerror.go
@@ -121,6 +121,10 @@ func (e *WskDeployBaseErr) SetMessage(message interface{}) {
}
}
+func (e *WskDeployBaseErr) AppendDetail(detail string){
+ e.appendDetail(detail)
+}
+
func (e *WskDeployBaseErr) appendDetail(detail string){
fmt := fmt.Sprintf("\n%s %s", STR_INDENT_1, detail)
e.Message = e.Message + fmt
diff --git a/wski18n/i18n_ids.go b/wski18n/i18n_ids.go
index 6f6a369..cbd7519 100644
--- a/wski18n/i18n_ids.go
+++ b/wski18n/i18n_ids.go
@@ -35,307 +35,130 @@ const(
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"
+ // 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"
+
+ // YAML marshall / unmarshall
+ ID_MSG_UNMARSHAL_LOCAL = "msg_unmarshall_local"
+ ID_MSG_UNMARSHAL_NETWORK = "msg_unmarshall_network"
+
// Informational
- 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_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"
- // Action Limits
- ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X = "msg_action_limit_ignored" // for timeout, memorySize, logSize
+ 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_DEPLOYMENT_SUCCEEDED = "msg_deployment_succeeded"
+ ID_MSG_DEPLOYMENT_FAILED = "msg_deployment_failed"
+ ID_MSG_DEPLOYMENT_CANCELLED = "msg_deployment_cancelled"
-//"id": "WARNING: Invalid limitation 'timeout' of action in manifest is ignored. Please check errors.\n",
-//"translation": "WARNING: Invalid limitation 'timeout' of action in manifest is ignored. Please check errors.\n"
-//},
-//{
-//"id": "WARNING: Invalid limitation 'memorySize' of action in manifest is ignored. Please check errors.\n",
-//"translation": "WARNING: Invalid limitation 'memorySize' of action in manifest is ignored. Please check errors.\n"
-//},
-//{
-//"id": "WARNING: Invalid limitation 'logSize' of action in manifest is ignored. Please check errors.\n",
-//"translation": "WARNING: Invalid limitation 'logSize' of action in manifest is ignored. Please check errors.\n"
-//},
+ 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_UNDEPLOYED_SUCCESS_X_key_X_name_X = "msg_entity_undeployed_success"
-//{
-//"id": "Unsupported runtime type, set to nodejs",
-//"translation": "Unsupported runtime type, set to nodejs"
-//},
-//{
-//"id": "The authentication key is not configured.\n",
-//"translation": "The authentication key is not configured.\n"
-//},
-//{
-//"id": "The API host is not configured.\n",
-//"translation": "The API host is not configured.\n"
-//},
-//{
-//"id": "The namespace is not configured.\n",
-//"translation": "The namespace is not configured.\n"
-//},
-//{
-//"id": "The API host is {{.apihost}}, from {{.apisource}}.\n",
-//"translation": "The API host is {{.apihost}}, from {{.apisource}}.\n"
-//},
-//{
-//"id": "The auth key is set, from {{.authsource}}.\n",
-//"translation": "The auth key is set, from {{.authsource}}.\n"
-//},
-//{
-//"id": "The namespace is {{.namespace}}, from {{.namespacesource}}.\n",
-//"translation": "The namespace is {{.namespace}}, from {{.namespacesource}}.\n"
-//},
-//{
-//"id": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n",
-//"translation": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n"
-//},
-//{
-//"id": "Start to unmarshal Openwhisk info from local values.\n",
-//"translation": "Start to unmarshal Openwhisk info from local values.\n"
-//},
-//{
-//"id": "Unmarshal Openwhisk info from internet.\n",
-//"translation": "Unmarshal Openwhisk info from internet.\n"
-//},
-//{
-//"id": "Deployment completed successfully.\n",
-//"translation": "Deployment completed successfully.\n"
-//},
-//{
-//"id": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating action with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating api with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating api with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating rule with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating rule with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error creating package binding with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error creating package binding with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Deployment of dependency {{.depName}} did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n",
-//"translation": "Deployment of dependency {{.depName}} did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
-//},
-//{
-//"id": "Deploying action {{.output}} ...",
-//"translation": "Deploying action {{.output}} ..."
-//},
-//{
-//"id": "Deploying rule {{.output}} ...",
-//"translation": "Deploying rule {{.output}} ..."
-//},
-//{
-//"id": "Deploying trigger feed {{.output}} ...",
-//"translation": "Deploying trigger feed {{.output}} ..."
-//},
-//{
-//"id": "Deploying package {{.output}} ...",
-//"translation": "Deploying package {{.output}} ..."
-//},
-//{
-//"id": "Deploying package binding {{.output}} ...",
-//"translation": "Deploying package binding {{.output}} ..."
-//},
-//{
-//"id": "Deploying dependency {{.output}} ...",
-//"translation": "Deploying dependency {{.output}} ..."
-//},
-//{
-//"id": "OK. Cancelling deployment.\n",
-//"translation": "OK. Cancelling deployment.\n"
-//},
-//{
-//"id": "OK. Canceling undeployment.\n",
-//"translation": "OK. Canceling undeployment.\n"
-//},
-//{
-//"id": "Undeployment did not complete sucessfully.\n",
-//"translation": "Undeployment did not complete sucessfully.\n"
-//},
-//{
-//"id": "Deployment removed successfully.\n",
-//"translation": "Deployment removed successfully.\n"
-//},
-//{
-//"id": "Undeployment did not complete sucessfully.\n",
-//"translation": "Undeployment did not complete sucessfully.\n"
-//},
-//{
-//"id": "Undeploying dependency {{.depName}} ...",
-//"translation": "Undeploying dependency {{.depName}} ..."
-//},
-//{
-//"id": "Undeployment of dependency {{.depName}} did not complete sucessfully.\n",
-//"translation": "Undeployment of dependency {{.depName}} did not complete sucessfully.\n"
-//},
-//{
-//"id": "Got error deleting action with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting action with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error deleting rule with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting rule with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Got error deleting package with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting package with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n",
-//"translation": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n"
-//},
-//{
-//"id": "Got error deleting binding package with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Got error deleting binding package with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "Dependency {{.output}} has been successfully deployed.\n",
-//"translation": "Dependency {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Package binding {{.output}} has been successfully deployed.\n",
-//"translation": "Package binding {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Package {{.output}} has been successfully deployed.\n",
-//"translation": "Package {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Trigger {{.output}} has been successfully deployed.\n",
-//"translation": "Trigger {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Trigger feed {{.output}} has been successfully deployed.\n",
-//"translation": "Trigger feed {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Rule {{.output}} has been successfully deployed.\n",
-//"translation": "Rule {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Action {{.output}} has been successfully deployed.\n",
-//"translation": "Action {{.output}} has been successfully deployed.\n"
-//},
-//{
-//"id": "Dependency {{.depName}} has been successfully undeployed.\n",
-//"translation": "Dependency {{.depName}} has been successfully undeployed.\n"
-//},
-//{
-//"id": "Trigger {{.trigger}} has been removed.\n",
-//"translation": "Trigger {{.trigger}} has been removed.\n"
-//},
-//{
-//"id": "Rule {{.rule}} has been removed.\n",
-//"translation": "Rule {{.rule}} has been removed.\n"
-//},
-//{
-//"id": "Action {{.action}} has been removed.\n",
-//"translation": "Action {{.action}} has been removed.\n"
-//},
-//{
-//"id": "Failed to invoke the feed when deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
-//"translation": "Failed to invoke the feed when deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
-//},
-//{
-//"id": "WARNING: Mandatory field Package Version must be set.\n",
-//"translation": "WARNING: Mandatory field Package Version must be set.\n"
-//},
-//{
-//"id": "WARNING: Package Version is not saved in the current wskdeploy version.\n",
-//"translation": "WARNING: Package Version is not saved in the current wskdeploy version.\n"
-//},
-//{
-//"id": "WARNING: Mandatory field Package License must be set.\n",
-//"translation": "WARNING: Mandatory field Package License must be set.\n"
-//},
-//{
-//"id": "WARNING: Package License is not saved in the current wskdeploy version.\n",
-//"translation": "WARNING: Package License is not saved in the current wskdeploy version.\n"
-//},
-//{
-//"id": "WARNING: License {{.licenseID}} is not a valid one.\n",
-//"translation": "WARNING: License {{.licenseID}} is not a valid one.\n"
-//},
-//{
-//"id": "memorySize of limits in manifest should be an integer between 128 and 512.\n",
-//"translation": "memorySize of limits in manifest should be an integer between 128 and 512.\n"
-//},
-//{
-//"id": "timeout of limits in manifest should be an integer between 100 and 300000.\n",
-//"translation": "timeout of limits in manifest should be an integer between 100 and 300000.\n"
-//},
-//{
-//"id": "logSize of limits in manifest should be an integer between 0 and 10.\n",
-//"translation": "logSize of limits in manifest should be an integer between 0 and 10.\n"
-//},
-//{
+ ID_MSG_UNDEPLOYMENT_SUCCEEDED = "msg_undeployment_succeeded"
+ ID_MSG_UNDEPLOYMENT_FAILED = "msg_undeployment_failed"
+ ID_MSG_UNDEPLOYMENT_CANCELLED = "msg_undeployment_cancelled"
-//{
-//"id": "WARNING: Limits {{.limitname}} is not changable as to now, which will be ignored.\n",
-//"translation": "WARNING: Limits {{.limitname}} is not changable as to now, which will be ignored.\n"
-//},
+ 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_DEPLOYMENT_FAILURE_X_name_X = "msg_dependency_deployment_failure"
+ ID_MSG_DEPENDENCY_UNDEPLOYMENT_SUCCESS_X_name_X = "msg_dependency_undeployment_success"
+ ID_MSG_DEPENDENCY_UNDEPLOYMENT_FAILURE_X_name_X = "msg_dependency_undeployment_failure"
+
+ // Managed deployments
+ ID_MSG_MANAGED_UNDEPLOYMENT_FAILED = "msg_undeployment_managed_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_NAMESPACE = "msg_prompt_namespace"
+
+ // Action Limits
+ ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X = "msg_action_limit_ignored" // timeout, memorySize, logSize
+
+ // warnings
+ ID_WARN_DEPRECATED_KEY_REPLACED = "msg_warn_key_deprecated_replaced"
+ ID_WARN_WHISK_PROPS_DEPRECATED = "msg_warn_whisk_properties"
+
+ // 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": "The name of the application {{.appNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the application {{.appNameManifest}}} in manifest file at [{{.manifestFile}}].",
-//"translation": "The name of the application {{.appNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the application {{.appNameManifest}}} in manifest file at [{{.manifestFile}}]."
-//},
-//{
-//"id": "WARNING: application in deployment file will soon be deprecated, please use project instead.\n",
-//"translation": "WARNING: application in deployment file will soon be deprecated, please use project instead.\n"
-//},
-//{
-//"id": "WARNING: application in manifest file will soon be deprecated, please use project instead.\n",
-//"translation": "WARNING: application in manifest file will soon be deprecated, please use project instead.\n"
-//},
-//{
-//"id": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n",
-//"translation": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
-//},
-//{
-//"id": "Found the action {{.action}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
-//"translation": "Found the action {{.action}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
-//},
-//{
-//"id": "Found the trigger {{.trigger}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
-//"translation": "Found the trigger {{.trigger}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
-//},
-//{
-//"id": "Found the package {{.package}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
-//"translation": "Found the package {{.package}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
-//}
\ No newline at end of file
+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_FLAG_API_HOST,
+ ID_CMD_FLAG_API_VERSION,
+ ID_CMD_FLAG_KEY_FILE,
+ ID_CMD_FLAG_CERT_FILE,
+ ID_MSG_CONFIG_MISSING_AUTHKEY,
+ ID_MSG_CONFIG_MISSING_APIHOST,
+ ID_MSG_CONFIG_MISSING_NAMESPACE,
+ 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_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_UNDEPLOYMENT_FAILURE_X_name_X,
+ ID_MSG_MANAGED_UNDEPLOYMENT_FAILED,
+ 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_PROMPT_APIHOST,
+ ID_MSG_PROMPT_NAMESPACE,
+ ID_MSG_ACTION_LIMIT_IGNORED_X_limit_X,
+ ID_WARN_DEPRECATED_KEY_REPLACED,
+ ID_WARN_WHISK_PROPS_DEPRECATED,
+ 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,
+}
diff --git a/wski18n/i18n_ids_test.go b/wski18n/i18n_ids_test.go
new file mode 100644
index 0000000..dd2f07b
--- /dev/null
+++ b/wski18n/i18n_ids_test.go
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package wski18n
+
+import (
+ "testing"
+ "github.com/stretchr/testify/assert"
+)
+
+/*
+ * TestValueNotEqualKey
+ */
+func TestValueNotEqualKey(t *testing.T) {
+
+ var value string
+ for _, key := range I18N_ID_SET {
+ value = T(key)
+ assert.NotEqual(t, key, value)
+ // NOTE: uncomment the following lines to see the i18n keys and values
+ //{
+ // u := int(math.Min(20, float64(len(value))))
+ // b := value[0:u]
+ // fmt.Printf("Info: [%s] != [%s]\n", key, b)
+ //}
+ }
+}
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index f95aded..1317895 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\xec\x5b\x4f\x6f\xdb\x3e\x12\xbd\xe7\x53\x0c\x72\xc9\x25\x30\xda\xdf\x62\x81\x45\x6f\xc1\xf6\xcf\x66\xdb\x24\x45\x92\xb6\x28\xba\x85\x43\x4b\x63\x89\x8d\x44\x0a\x24\x95\xd4\x35\xfc\xdd\x17\x24\x25\x5b\x49\x45\x8a\x92\x65\x27\x28\x7e\x3d\x29\x96\xe6\xbd\x37\xd4\x90\x9c\xa1\xa6\xdf\x0e\x00\x96\x07\x00\x00\x87\x34\x3e\x7c\x05\x87\xb9\x4c\xa6\x85\xc0\x39\xfd\x39\x45\x21\xb8\x38\x3c\xb6\x77\x95\x20\x4c\x66\x44 [...]
+var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x59\x51\x6f\x1b\xb9\x11\x7e\xf7\xaf\x18\xe4\xc5\x2d\x60\xa8\xc9\x15\x05\x8a\x00\x45\x61\xd4\x6e\xeb\xde\xc5\x36\xec\xe4\x82\x43\x2e\x58\xd3\xcb\xd9\x15\x4f\x5c\x72\x41\x72\xa5\xe8\x04\xfd\xf7\x62\xc8\xa5\xb4\xb2\xc5\xdd\x95\xe2\x5c\xfc\xb4\x16\x87\xdf\x37\x33\x24\x67\x86\xc3\x4f\x27\x00\xab\x13\x00\x80\x57\x82\xbf\x7a\x0b\xaf\x2a\x5b\x66\xb5\xc1\x42\x7c\xc9\xd0\x18\x6d\x5e\x9d\x85\x51\x67\x98\xb2\x92 [...]
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: 14368, mode: os.FileMode(420), modTime: time.Unix(1515166936, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 9436, mode: os.FileMode(420), modTime: time.Unix(1515552461, 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 dcdd75e..eafe7bd 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -44,6 +44,26 @@
"translation": "path of the .cert file"
},
{
+ "id": "msg_prompt_deploy",
+ "translation": "Do you really want to deploy this? (y/N): "
+ },
+ {
+ "id": "msg_prompt_undeploy",
+ "translation": "Do you really want to undeploy this? (y/N): "
+ },
+ {
+ "id": "msg_prompt_authkey",
+ "translation": "\nPlease provide an authentication token: "
+ },
+ {
+ "id": "msg_prompt_apihost",
+ "translation": "\nPlease provide the hostname for OpenWhisk: "
+ },
+ {
+ "id": "msg_prompt_namespace",
+ "translation": "\nPlease provide a namespace [default value is guest]: "
+ },
+ {
"id": "msg_manifest_not_found",
"translation": "Manifest file not found at path [{{.path}}].\n"
},
@@ -72,208 +92,143 @@
"translation": "Invalid action limit [{{.limit}}] in manifest is ignored.\n"
},
{
- "id": "The authentication key is not configured.\n",
+ "id": "msg_config_missing_authkey",
"translation": "The authentication key is not configured.\n"
},
{
- "id": "The API host is not configured.\n",
+ "id": "msg_config_missing_apihost",
"translation": "The API host is not configured.\n"
},
{
- "id": "The namespace is not configured.\n",
+ "id": "msg_config_missing_namespace",
"translation": "The namespace is not configured.\n"
},
{
- "id": "The API host is {{.apihost}}, from {{.apisource}}.\n",
- "translation": "The API host is {{.apihost}}, from {{.apisource}}.\n"
+ "id": "msg_config_apihost_info",
+ "translation": "The API host is {{.host}}, from {{.source}}.\n"
},
{
- "id": "The auth key is set, from {{.authsource}}.\n",
- "translation": "The auth key is set, from {{.authsource}}.\n"
+ "id": "msg_config_authkey_info",
+ "translation": "The auth key is set, from {{.source}}.\n"
},
{
- "id": "The namespace is {{.namespace}}, from {{.namespacesource}}.\n",
- "translation": "The namespace is {{.namespace}}, from {{.namespacesource}}.\n"
+ "id": "msg_config_namespace_info",
+ "translation": "The namespace is {{.namespace}}, from {{.source}}.\n"
},
{
- "id": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n",
+ "id": "msg_err_get_runtimes",
"translation": "Failed to get the supported runtimes from OpenWhisk service: {{.err}}.\n"
},
{
- "id": "Start to unmarshal Openwhisk info from local values.\n",
- "translation": "Start to unmarshal Openwhisk info from local values.\n"
+ "id": "msg_unmarshall_local",
+ "translation": "Unmarshal OpenWhisk info from local values.\n"
},
{
- "id": "Unmarshal Openwhisk info from internet.\n",
- "translation": "Unmarshal Openwhisk info from internet.\n"
+ "id": "msg_unmarshall_network",
+ "translation": "Unmarshal OpenWhisk info from internet.\n"
},
{
- "id": "Deployment completed successfully.\n",
+ "id": "msg_deployment_succeeded",
"translation": "Deployment completed successfully.\n"
},
{
- "id": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating action with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating package with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating api with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating api with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating rule with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating rule with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating trigger with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Got error creating package binding with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error creating package binding with error message: {{.err}} and error code: {{.code}}.\n"
- },
- {
- "id": "Deployment of dependency {{.depName}} did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n",
- "translation": "Deployment of dependency {{.depName}} did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
- },
- {
- "id": "Deploying action {{.output}} ...",
- "translation": "Deploying action {{.output}} ..."
- },
- {
- "id": "Deploying rule {{.output}} ...",
- "translation": "Deploying rule {{.output}} ..."
- },
- {
- "id": "Deploying trigger feed {{.output}} ...",
- "translation": "Deploying trigger feed {{.output}} ..."
- },
- {
- "id": "Deploying package {{.output}} ...",
- "translation": "Deploying package {{.output}} ..."
- },
- {
- "id": "Deploying package binding {{.output}} ...",
- "translation": "Deploying package binding {{.output}} ..."
- },
- {
- "id": "Deploying dependency {{.output}} ...",
- "translation": "Deploying dependency {{.output}} ..."
+ "id": "msg_deployment_failed",
+ "translation": "Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
},
{
- "id": "OK. Cancelling deployment.\n",
+ "id": "msg_deployment_cancelled",
"translation": "OK. Cancelling deployment.\n"
},
{
- "id": "OK. Canceling undeployment.\n",
- "translation": "OK. Canceling undeployment.\n"
- },
- {
- "id": "Undeployment did not complete sucessfully.\n",
- "translation": "Undeployment did not complete sucessfully.\n"
- },
- {
- "id": "Deployment removed successfully.\n",
- "translation": "Deployment removed successfully.\n"
+ "id": "msg_undeployment_succeeded",
+ "translation": "Undeployment completed successfully.\n"
},
{
- "id": "Undeployment did not complete sucessfully.\n",
+ "id": "msg_undeployment_failed",
"translation": "Undeployment did not complete sucessfully.\n"
},
{
- "id": "Undeploying dependency {{.depName}} ...",
- "translation": "Undeploying dependency {{.depName}} ..."
+ "id": "msg_undeployment_cancelled",
+ "translation": "OK. Cancelling undeployment.\n"
},
{
- "id": "Undeployment of dependency {{.depName}} did not complete sucessfully.\n",
- "translation": "Undeployment of dependency {{.depName}} did not complete sucessfully.\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": "Got error deleting action with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting action with error message: {{.err}} and error code: {{.code}}.\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": "Got error deleting rule with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting rule with error message: {{.err}} and error code: {{.code}}.\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": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error setting the status of rule with error message: {{.err}} and error code: {{.code}}.\n"
+ { "id": "msg_err_missing_mandatory_key",
+ "translation": "The mandatory key [{{.key}}] is missing."
},
{
- "id": "Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting trigger with error message: {{.err}} and error code: {{.code}}.\n"
+ "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": "Got error deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n"
+ "id": "msg_deploying_dependency",
+ "translation": "Deploying dependency [{{.name}}]..."
},
{
- "id": "Got error deleting package with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting package with error message: {{.err}} and error code: {{.code}}.\n"
+ "id": "msg_undeploying_dependency",
+ "translation": "Undeploying dependency [{{.name}}]..."
},
{
- "id": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n",
- "translation": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n"
+ "id": "msg_dependency_deployment_success",
+ "translation": "Dependency [{{.name}}] has been successfully deployed.\n"
},
{
- "id": "Got error deleting binding package with error message: {{.err}} and error code: {{.code}}.\n",
- "translation": "Got error deleting binding package with error message: {{.err}} and error code: {{.code}}.\n"
+ "id": "msg_dependency_deployment_failure",
+ "translation": "Deployment of dependency [{{.name}}] did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
},
{
- "id": "Dependency {{.output}} has been successfully deployed.\n",
- "translation": "Dependency {{.output}} has been successfully deployed.\n"
+ "id": "msg_dependency_undeployment_success",
+ "translation": "Dependency [{{.name}}] has been successfully undeployed.\n"
},
{
- "id": "Package binding {{.output}} has been successfully deployed.\n",
- "translation": "Package binding {{.output}} has been successfully deployed.\n"
+ "id": "msg_dependency_undeployment_failure",
+ "translation": "Undeployment of dependency [{{.name}}] did not complete sucessfully.\n"
},
{
- "id": "Package {{.output}} has been successfully deployed.\n",
- "translation": "Package {{.output}} has been successfully deployed.\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": "Trigger {{.output}} has been successfully deployed.\n",
- "translation": "Trigger {{.output}} has been successfully deployed.\n"
+ "id": "msg_err_create_entity",
+ "translation": "Error creating {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
},
{
- "id": "Trigger feed {{.output}} has been successfully deployed.\n",
- "translation": "Trigger feed {{.output}} has been successfully deployed.\n"
+ "id": "msg_err_delete_entity",
+ "translation": "Error deleting {{.key}} with error message: {{.err}} and error code: {{.code}}.\n"
},
{
- "id": "Rule {{.output}} has been successfully deployed.\n",
- "translation": "Rule {{.output}} has been successfully deployed.\n"
+ "id": "msg_entity_deploying",
+ "translation": "Deploying {{.key}} [{{.name}}] ..."
},
{
- "id": "Action {{.output}} has been successfully deployed.\n",
- "translation": "Action {{.output}} has been successfully deployed.\n"
+ "id": "msg_entity_undeploying",
+ "translation": "Undeploying {{.key}} [{{.name}}] ..."
},
{
- "id": "Dependency {{.depName}} has been successfully undeployed.\n",
- "translation": "Dependency {{.depName}} has been successfully undeployed.\n"
+ "id": "msg_entity_deployed_success",
+ "translation": "{{.key}} [{{.name}}] has been successfully deployed.\n"
},
{
- "id": "Trigger {{.trigger}} has been removed.\n",
- "translation": "Trigger {{.trigger}} has been removed.\n"
+ "id": "msg_entity_undeployed_success",
+ "translation": "{{.key}} [{{.name}}] has been successfully undeployed.\n"
},
{
- "id": "Rule {{.rule}} has been removed.\n",
- "translation": "Rule {{.rule}} has been removed.\n"
+ "id": "SEPARATOR",
+ "translation": "====================== Entries below this line are not verified ==================================="
},
{
- "id": "Action {{.action}} has been removed.\n",
- "translation": "Action {{.action}} has been removed.\n"
+ "id": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n",
+ "translation": "WARNING: The 'source' YAML key in trigger entity is deprecated. Please use 'feed' instead as described in specifications.\n"
},
{
"id": "Failed to invoke the feed when deleting trigger feed with error message: {{.err}} and error code: {{.code}}.\n",
@@ -316,32 +271,7 @@
"translation": "WARNING: Limits {{.limitname}} is not changable as to now, which will be ignored.\n"
},
{
- "id": "The name of the application {{.appNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the application {{.appNameManifest}}} in manifest file at [{{.manifestFile}}].",
- "translation": "The name of the application {{.appNameDeploy}} in deployment file at [{{.deploymentFile}}] does not match the name of the application {{.appNameManifest}}} in manifest file at [{{.manifestFile}}]."
- },
- {
"id": "WARNING: application in deployment file will soon be deprecated, please use project instead.\n",
"translation": "WARNING: application in deployment file will soon be deprecated, please use project instead.\n"
- },
- {
- "id": "WARNING: application in manifest file will soon be deprecated, please use project instead.\n",
- "translation": "WARNING: application in manifest file will soon be deprecated, please use project instead.\n"
- },
- {
- "id": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n",
- "translation": "Undeployment of deleted entities did not complete sucessfully during managed deployment. Run `wskdeploy undeploy` to remove partially deployed assets.\n"
- },
- {
- "id": "Found the action {{.action}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
- "translation": "Found the action {{.action}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
- },
- {
- "id": "Found the trigger {{.trigger}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
- "translation": "Found the trigger {{.trigger}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
- },
- {
- "id": "Found the package {{.package}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n",
- "translation": "Found the package {{.package}} which is deleted from the current project {{.project}} in manifest file which is being undeployed.\n"
}
-
]
--
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].