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

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


The following commit(s) were added to refs/heads/master by this push:
     new eaf3b86  Deprecating Interactive Mode and introducing Preview (#807)
eaf3b86 is described below

commit eaf3b868ffcebf46fea3b418d528d5dc31f12084
Author: Priti Desai <[email protected]>
AuthorDate: Tue Mar 20 12:37:22 2018 -0700

    Deprecating Interactive Mode and introducing Preview (#807)
    
    * deprecating interactive mode in favor of Dry Run
    
    * renaming dryrun to preview
    
    * updating i18 resources
---
 cmd/export.go                             |  2 +-
 cmd/report.go                             |  4 +-
 cmd/root.go                               | 11 ++--
 cmd/root_test.go                          |  9 ++--
 deployers/servicedeployer.go              | 90 +++++--------------------------
 deployers/whiskclient.go                  | 69 ++----------------------
 deployers/whiskclient_test.go             | 31 ++++-------
 docs/wskdeploy_configuring.md             |  9 ----
 docs/wskdeploy_faq.md                     |  1 -
 docs/wskdeploy_package_minimal.md         | 10 ++--
 parsers/manifest_parser.go                |  1 -
 tests/src/integration/common/wskdeploy.go |  2 +-
 utils/flags.go                            |  2 +-
 utils/misc.go                             | 27 +++-------
 wski18n/i18n_ids.go                       | 16 +-----
 wski18n/i18n_resources.go                 | 22 ++++----
 wski18n/resources/en_US.all.json          | 24 +--------
 17 files changed, 68 insertions(+), 262 deletions(-)

diff --git a/cmd/export.go b/cmd/export.go
index 1f8655c..437fb4f 100644
--- a/cmd/export.go
+++ b/cmd/export.go
@@ -117,7 +117,7 @@ func ExportCmdImp(cmd *cobra.Command, args []string) error {
        maniyaml := &parsers.YAML{}
        maniyaml.Project.Name = projectName
 
-       config, _ = deployers.NewWhiskConfig(wskpropsPath, 
utils.Flags.DeploymentPath, utils.Flags.ManifestPath, false)
+       config, _ = deployers.NewWhiskConfig(wskpropsPath, 
utils.Flags.DeploymentPath, utils.Flags.ManifestPath)
        client, _ = deployers.CreateNewClient(config)
 
        // Init supported runtimes and action files extensions maps
diff --git a/cmd/report.go b/cmd/report.go
index 655a4b2..3ef86a9 100644
--- a/cmd/report.go
+++ b/cmd/report.go
@@ -42,7 +42,7 @@ var reportCmd = &cobra.Command{
        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)
+                       config, _ := deployers.NewWhiskConfig(wskpropsPath, 
utils.Flags.DeploymentPath, utils.Flags.ManifestPath)
                        client, _ := deployers.CreateNewClient(config)
                        return printDeploymentInfo(client)
                } else {
@@ -51,7 +51,7 @@ var reportCmd = &cobra.Command{
                        // 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)
+                       config, _ := deployers.NewWhiskConfig(propPath, 
utils.Flags.DeploymentPath, utils.Flags.ManifestPath)
                        client, _ := deployers.CreateNewClient(config)
                        return printDeploymentInfo(client)
                }
diff --git a/cmd/root.go b/cmd/root.go
index c29eca1..ca660a9 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -117,7 +117,7 @@ func init() {
        RootCmd.PersistentFlags().StringVarP(&utils.Flags.ManifestPath, 
"manifest", "m", "", wski18n.T(wski18n.ID_CMD_FLAG_MANIFEST))
        RootCmd.PersistentFlags().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.Preview, "preview", "", 
false, wski18n.T(wski18n.ID_CMD_FLAG_PREVIEW))
        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))
@@ -230,7 +230,7 @@ func Deploy() error {
                deployer.ProjectPath = projectPath
                deployer.ManifestPath = utils.Flags.ManifestPath
                deployer.DeploymentPath = utils.Flags.DeploymentPath
-               deployer.IsInteractive = utils.Flags.UseInteractive
+               deployer.Preview = utils.Flags.Preview
 
                // master record of any dependency that has been downloaded
                deployer.DependencyMaster = 
make(map[string]utils.DependencyRecord)
@@ -238,8 +238,7 @@ func Deploy() error {
                clientConfig, error := deployers.NewWhiskConfig(
                        utils.Flags.CfgFile,
                        utils.Flags.DeploymentPath,
-                       utils.Flags.ManifestPath,
-                       deployer.IsInteractive)
+                       utils.Flags.ManifestPath)
                if error != nil {
                        return error
                }
@@ -310,9 +309,9 @@ func Undeploy() error {
                deployer.ProjectPath = utils.Flags.ProjectPath
                deployer.ManifestPath = utils.Flags.ManifestPath
                deployer.DeploymentPath = utils.Flags.DeploymentPath
-               deployer.IsInteractive = utils.Flags.UseInteractive
+               deployer.Preview = utils.Flags.Preview
 
-               clientConfig, error := 
deployers.NewWhiskConfig(utils.Flags.CfgFile, utils.Flags.DeploymentPath, 
utils.Flags.ManifestPath, deployer.IsInteractive)
+               clientConfig, error := 
deployers.NewWhiskConfig(utils.Flags.CfgFile, utils.Flags.DeploymentPath, 
utils.Flags.ManifestPath)
                if error != nil {
                        return error
                }
diff --git a/cmd/root_test.go b/cmd/root_test.go
index c370e60..72f6396 100644
--- a/cmd/root_test.go
+++ b/cmd/root_test.go
@@ -74,7 +74,7 @@ type Input struct {
        ProjectPath    string
        DeploymentPath string
        ManifestPath   string
-       UseInteractive bool
+       Preview        bool
 }
 
 var expected_input Input
@@ -88,7 +88,7 @@ func initializeParameters() {
 
        expected_input.CfgFile = os.Getenv("GOPATH") + 
"/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/dat/wskprops"
        expected_input.Verbose = true
-       expected_input.UseInteractive = true
+       expected_input.Preview = false
        expected_input.ProjectPath = "fake_project_path"
        expected_input.DeploymentPath = "fake_deployment_path"
        expected_input.ManifestPath = "fake_manifest_path"
@@ -103,7 +103,7 @@ func checkValidAuthInfo(t *testing.T, expected_auth_flags 
Auth_flags) {
 func checkValidInputInfo(t *testing.T, expected_input Input) {
        assert.Equal(t, expected_input.CfgFile, utils.Flags.CfgFile, "CfgFile 
does not match.")
        assert.Equal(t, expected_input.Verbose, utils.Flags.Verbose, "Verbose 
does not match.")
-       assert.Equal(t, expected_input.UseInteractive, 
utils.Flags.UseInteractive, "ApiHoUseInteractivest does not match.")
+       assert.Equal(t, expected_input.Preview, utils.Flags.Preview, "Preview 
does not match.")
        assert.Equal(t, expected_input.ProjectPath, utils.Flags.ProjectPath, 
"ProjectPath does not match.")
        assert.Equal(t, expected_input.DeploymentPath, 
utils.Flags.DeploymentPath, "DeploymentPath does not match.")
        assert.Equal(t, expected_input.ManifestPath, utils.Flags.ManifestPath, 
"ManifestPath does not match.")
@@ -135,9 +135,6 @@ func composeCommand(auth Auth_flags, input Input) string {
        if input.Verbose {
                cmd = cmd + "-v "
        }
-       if input.UseInteractive {
-               cmd = cmd + "-i "
-       }
        return cmd
 }
 
diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index 7fa8abe..023e18e 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -18,10 +18,8 @@
 package deployers
 
 import (
-       "bufio"
        "fmt"
        "net/http"
-       "os"
        "path"
        "reflect"
        "strconv"
@@ -82,16 +80,14 @@ func NewDeploymentPackage() *DeploymentPackage {
 //   3. Collect information about the source code files in the working 
directory
 //   4. Create a deployment plan to create OpenWhisk service
 type ServiceDeployer struct {
-       ProjectName    string
-       Deployment     *DeploymentProject
-       Client         *whisk.Client
-       mt             sync.RWMutex
-       IsInteractive  bool
-       ManifestPath   string
-       ProjectPath    string
-       DeploymentPath string
-       // whether to deploy the action under the package
-       InteractiveChoice bool
+       ProjectName       string
+       Deployment        *DeploymentProject
+       Client            *whisk.Client
+       mt                sync.RWMutex
+       Preview           bool
+       ManifestPath      string
+       ProjectPath       string
+       DeploymentPath    string
        ClientConfig      *whisk.Config
        DependencyMaster  map[string]utils.DependencyRecord
        ManagedAnnotation whisk.KeyValue
@@ -101,7 +97,7 @@ type ServiceDeployer struct {
 func NewServiceDeployer() *ServiceDeployer {
        var dep ServiceDeployer
        dep.Deployment = NewDeploymentProject()
-       dep.IsInteractive = true
+       dep.Preview = true
        dep.DependencyMaster = make(map[string]utils.DependencyRecord)
 
        return &dep
@@ -264,41 +260,11 @@ func (deployer *ServiceDeployer) 
ConstructUnDeploymentPlan() (*DeploymentProject
 // TODO(TBD): according to some planning?
 func (deployer *ServiceDeployer) Deploy() error {
 
-       if deployer.IsInteractive == true {
+       if deployer.Preview {
                deployer.printDeploymentAssets(deployer.Deployment)
-
-               // 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)
-
-               if text == "" {
-                       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 {
-                               
wskprint.PrintOpenWhiskError(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_FAILED))
-                               return err
-                       }
-
-                       
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(wski18n.ID_MSG_DEPLOYMENT_CANCELLED))
-                       return nil
-               }
+               return nil
        }
 
-       // non-interactive
        if err := deployer.deployAssets(); err != nil {
                
wskprint.PrintOpenWhiskError(wski18n.T(wski18n.ID_MSG_DEPLOYMENT_FAILED))
                return err
@@ -955,39 +921,11 @@ func (deployer *ServiceDeployer) createApi(api 
*whisk.ApiCreateRequest) error {
 }
 
 func (deployer *ServiceDeployer) UnDeploy(verifiedPlan *DeploymentProject) 
error {
-       if deployer.IsInteractive == true {
+       if deployer.Preview == true {
                deployer.printDeploymentAssets(verifiedPlan)
-
-               // 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)
-
-               if text == "" {
-                       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(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_FAILED)))
-                               return err
-                       }
-
-                       
wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_SUCCEEDED)))
-                       return nil
-
-               } else {
-                       deployer.InteractiveChoice = false
-                       
wskprint.PrintOpenWhiskSuccess(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_CANCELLED)))
-                       return nil
-               }
+               return nil
        }
 
-       // non-interactive
        if err := deployer.unDeployAssets(verifiedPlan); err != nil {
                
wskprint.PrintOpenWhiskError(wski18n.T(wski18n.T(wski18n.ID_MSG_UNDEPLOYMENT_FAILED)))
                return err
@@ -1528,7 +1466,7 @@ func (deployer *ServiceDeployer) 
getDependentDeployer(depName string, depRecord
        depServiceDeployer.ProjectPath = projectPath
        depServiceDeployer.ManifestPath = manifestPath
        depServiceDeployer.DeploymentPath = deploymentPath
-       depServiceDeployer.IsInteractive = true
+       depServiceDeployer.Preview = true
 
        depServiceDeployer.Client = deployer.Client
        depServiceDeployer.ClientConfig = deployer.ClientConfig
diff --git a/deployers/whiskclient.go b/deployers/whiskclient.go
index 7f60359..7d01bda 100644
--- a/deployers/whiskclient.go
+++ b/deployers/whiskclient.go
@@ -18,8 +18,6 @@
 package deployers
 
 import (
-       "bufio"
-       "fmt"
        "net/http"
        "os"
        "path"
@@ -36,10 +34,9 @@ import (
 
 // Possible sources for config info (e.g., API Host, Auth Key, Namespace)
 const (
-       SOURCE_WSKPROPS          = ".wskprops"
-       SOURCE_WHISK_PROPERTIES  = "whisk.properties"
-       SOURCE_INTERACTIVE_INPUT = "interactve input"  // TODO() i18n?
-       SOURCE_DEFAULT_VALUE     = "wskdeploy default" // TODO() i18n?
+       SOURCE_WSKPROPS         = ".wskprops"
+       SOURCE_WHISK_PROPERTIES = "whisk.properties"
+       SOURCE_DEFAULT_VALUE    = "wskdeploy default" // TODO() i18n?
 )
 
 var (
@@ -174,52 +171,14 @@ func readFromWhiskProperty(pi whisk.PropertiesImp) {
        }
 }
 
-func readInteractivly() {
-       if len(apiHost.Value) == 0 {
-               host := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_APIHOST))
-               if host == "" {
-                       // TODO() programmatically tell caller that we are 
using this default
-                       // TODO() make this configurable or remove
-                       host = "openwhisk.ng.bluemix.net"
-               }
-               apiHost = GetPropertyValue(apiHost, host, 
SOURCE_INTERACTIVE_INPUT)
-       }
-
-       if len(credential.Value) == 0 {
-               cred := promptForValue(wski18n.T(wski18n.ID_MSG_PROMPT_AUTHKEY))
-               credential.Value = cred
-               credential.Source = SOURCE_INTERACTIVE_INPUT
-
-               // 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 := SOURCE_INTERACTIVE_INPUT
-
-                       if tempNamespace == "" {
-                               tempNamespace = whisk.DEFAULT_NAMESPACE
-                               source = SOURCE_DEFAULT_VALUE
-                       }
-
-                       namespace = GetPropertyValue(namespace, tempNamespace, 
source)
-               }
-       }
-
-       if len(apigwAccessToken.Value) == 0 {
-               accessToken := 
promptForValue(wski18n.T(wski18n.APIGW_ACCESS_TOKEN))
-               apigwAccessToken = GetPropertyValue(apigwAccessToken, 
accessToken, SOURCE_INTERACTIVE_INPUT)
-       }
-}
-
 // we are reading openwhisk credentials (apihost, namespace, and auth) in the 
following precedence order:
 // (1) wskdeploy command line `wskdeploy --apihost --namespace --auth`
 // (2) deployment file
 // (3) manifest file
 // (4) .wskprops
-// (5) prompt for values in interactive mode if any of them are missing
 // we are following the same precedence order for APIGW_ACCESS_TOKEN
 // but as a separate thread as APIGW_ACCESS_TOKEN only needed for APIs
-func NewWhiskConfig(proppath string, deploymentPath string, manifestPath 
string, isInteractive bool) (*whisk.Config, error) {
+func NewWhiskConfig(proppath string, deploymentPath string, manifestPath 
string) (*whisk.Config, error) {
        // reset credential, apiHost, namespace, etc to avoid any conflicts as 
they initialized globally
        resetWhiskConfig()
 
@@ -258,13 +217,6 @@ func NewWhiskConfig(proppath string, deploymentPath 
string, manifestPath string,
                namespace.Source = SOURCE_DEFAULT_VALUE
        }
 
-       // 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 isInteractive {
-               readInteractivly()
-       }
-
        mode := true
        if len(cert.Value) != 0 && len(key.Value) != 0 {
                mode = false
@@ -274,7 +226,7 @@ func NewWhiskConfig(proppath string, deploymentPath string, 
manifestPath string,
                AuthToken:        credential.Value, //Authtoken
                Namespace:        namespace.Value,  //Namespace
                Host:             apiHost.Value,
-               Version:          "v1", // TODO() should not be hardcoded, 
should prompt/warn user of default
+               Version:          "v1", // TODO() should not be hardcoded, 
should warn user of default
                Cert:             cert.Value,
                Key:              key.Value,
                Insecure:         mode, // true if you want to ignore 
certificate signing
@@ -335,14 +287,3 @@ func validateClientConfig(credential PropertyValue, 
apiHost PropertyValue, names
 
        return nil
 }
-
-// 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)
-
-       text, _ := reader.ReadString('\n')
-       text = strings.TrimSpace(text)
-
-       return text
-}
diff --git a/deployers/whiskclient_test.go b/deployers/whiskclient_test.go
index f27f991..7f23378 100644
--- a/deployers/whiskclient_test.go
+++ b/deployers/whiskclient_test.go
@@ -66,7 +66,7 @@ func TestNewWhiskConfig(t *testing.T) {
        propPath := ""
        manifestPath := ""
        deploymentPath := ""
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        if err == nil {
                pi := whisk.PropertiesImp{
                        OsPackage: whisk.OSPackageImp{},
@@ -90,7 +90,7 @@ func TestNewWhiskConfigCommandLine(t *testing.T) {
        utils.Flags.Auth = CLI_AUTH
        utils.Flags.Namespace = CLI_NAMESPACE
 
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        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")
@@ -99,7 +99,7 @@ func TestNewWhiskConfigCommandLine(t *testing.T) {
 
        utils.Flags.Key = WSKPROPS_KEY
        utils.Flags.Cert = WSKPROPS_CERT
-       config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath)
        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")
@@ -115,7 +115,7 @@ func TestNewWhiskConfigDeploymentFile(t *testing.T) {
        propPath := ""
        manifestPath := ""
        deploymentPath := "../tests/dat/deployment_validate_credentials.yaml"
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from deployment file")
        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")
@@ -139,7 +139,7 @@ func TestNewWhiskConfigWithWskProps(t *testing.T) {
        propPath := "../tests/dat/wskprops"
        manifestPath := ""
        deploymentPath := ""
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        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")
@@ -149,7 +149,7 @@ func TestNewWhiskConfigWithWskProps(t *testing.T) {
        assert.False(t, config.Insecure, "Config should set insecure to false")
 
        propPath = "../tests/dat/wskpropsnokeycert"
-       config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err = NewWhiskConfig(propPath, deploymentPath, manifestPath)
        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")
@@ -159,15 +159,6 @@ func TestNewWhiskConfigWithWskProps(t *testing.T) {
        assert.True(t, config.Insecure, "Config should set insecure to true")
 }
 
-// TODO(#693) add the following test
-/*func TestNewWhiskConfigInteractiveMode(t *testing.T) {
-       propPath := ""
-       manifestPath := ""
-       deploymentPath := ""
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
true)
-       assert.Nil(t, err, "Failed to read credentials in interactive mode")
-}*/
-
 func TestNewWhiskConfigWithCLIDeploymentAndManifestFile(t *testing.T) {
        propPath := ""
        manifestPath := "../tests/dat/manifest_validate_credentials.yaml"
@@ -177,7 +168,7 @@ func TestNewWhiskConfigWithCLIDeploymentAndManifestFile(t 
*testing.T) {
        utils.Flags.Auth = CLI_AUTH
        utils.Flags.Namespace = CLI_NAMESPACE
 
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from CLI or deployment 
or manifest file")
        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")
@@ -196,7 +187,7 @@ func TestNewWhiskConfigWithCLIAndDeployment(t *testing.T) {
        utils.Flags.Auth = CLI_AUTH
        utils.Flags.Namespace = CLI_NAMESPACE
 
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from wskdeploy CLI")
        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")
@@ -215,7 +206,7 @@ func TestNewWhiskConfigWithCLIAndManifest(t *testing.T) {
        utils.Flags.Auth = CLI_AUTH
        utils.Flags.Namespace = CLI_NAMESPACE
 
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from manifest file")
        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")
@@ -233,7 +224,7 @@ func TestNewWhiskConfigWithCLIAndWskProps(t *testing.T) {
        utils.Flags.ApiHost = CLI_HOST
        utils.Flags.Auth = CLI_AUTH
        utils.Flags.Namespace = CLI_NAMESPACE
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from wskdeploy command 
line")
        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")
@@ -247,7 +238,7 @@ func TestNewWhiskConfigWithDeploymentAndManifestFile(t 
*testing.T) {
        propPath := ""
        manifestPath := "../tests/dat/manifest_validate_credentials.yaml"
        deploymentPath := "../tests/dat/deployment_validate_credentials.yaml"
-       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath, 
false)
+       config, err := NewWhiskConfig(propPath, deploymentPath, manifestPath)
        assert.Nil(t, err, "Failed to read credentials from manifest or 
deployment file")
        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")
diff --git a/docs/wskdeploy_configuring.md b/docs/wskdeploy_configuring.md
index f2eadfa..b5d8023 100644
--- a/docs/wskdeploy_configuring.md
+++ b/docs/wskdeploy_configuring.md
@@ -50,12 +50,3 @@ Values set using the Whisk Command Line Interface (CLI) are 
stored in a ```.wskp
 
 It assumes that you have setup and can run the wskdeploy as described in the 
project README. If so, then the utility will use the OpenWhisk APIHOST and AUTH 
variable values in your .wskprops file to attempt deployment.
 
-5. **Interactice mode**
-
-If interactive mode is enabled (i.e., using the ```-i``` or 
```--allow-interactive``` flags) then wskdeploy will prompt for any missing 
(required) values.
-
-for example:
-
-```
-$ wskdeploy -i -m manifest.yaml
-```
diff --git a/docs/wskdeploy_faq.md b/docs/wskdeploy_faq.md
index 8aa7cfc..c3ce687 100644
--- a/docs/wskdeploy_faq.md
+++ b/docs/wskdeploy_faq.md
@@ -26,4 +26,3 @@
 
 -  The ```wskdeploy``` utility will cease deploying as soon as it receives an 
error from the target platform and display what error information it receives 
to you.
 - then it will attempt to undeploy any entities that it attempted to deploy.
-  - If "interactive mode" was used to deploy, then you will be prompted to 
confirm you wish to undeploy.
diff --git a/docs/wskdeploy_package_minimal.md 
b/docs/wskdeploy_package_minimal.md
index 772537a..59458b5 100644
--- a/docs/wskdeploy_package_minimal.md
+++ b/docs/wskdeploy_package_minimal.md
@@ -53,15 +53,15 @@ If you called your manifest "manifest_helloworld.yaml" (not 
using the default ma
 $ wskdeploy -p <my_directory> -m docs/examples/manifest_package_minimal.yaml
 ```
 
-#### Interactive mode
+#### Dry Run mode
 
-If you want to simply verify your manifest file can be read and parsed 
properly before deploying, you can add the ```-i``` or 
```--allow-interactive``` flag:
+If you want to simply verify your manifest file can be read and parsed 
properly before deploying, you can add the ```--preview``` flag:
 
 ```sh
-$ ./wskdeploy -i -m docs/examples/manifest_package_minimal.yaml
+$ ./wskdeploy --preview -m docs/examples/manifest_package_minimal.yaml
 ```
 
-and the utility will stop, show you all the OpenWhisk package components it 
will deploy from your manifest and ask you if you want to deploy them or not.
+and the utility will stop, show you all the OpenWhisk package components it 
will deploy from your manifest.
 
 ```sh
 Package:
@@ -70,8 +70,6 @@ Name: hello_world_package
   annotations:
 Triggers:
 Rules:
-
-Do you really want to deploy this? (y/N):
 ```
 
 ### Result
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 0e754cb..763dcbc 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -170,7 +170,6 @@ func (dm *YAMLParser) ComposeDependencies(pkg Package, 
projectPath string, fileP
        for key, dependency := range pkg.Dependencies {
                version := dependency.Version
                if len(version) == 0 {
-                       // TODO() interactive ask for branch, AND consider YAML 
specification to allow key for branch
                        version = YAML_VALUE_BRANCH_MASTER
                }
 
diff --git a/tests/src/integration/common/wskdeploy.go 
b/tests/src/integration/common/wskdeploy.go
index 82a3404..2eb18e5 100644
--- a/tests/src/integration/common/wskdeploy.go
+++ b/tests/src/integration/common/wskdeploy.go
@@ -194,7 +194,7 @@ func (wskdeploy *Wskdeploy) 
GetDeploymentObjects(manifestPath string, deployment
        //these values might be mock values because it's only for testing
        userHome := utils.GetHomeDirectory()
        defaultPath := path.Join(userHome, whisk.DEFAULT_LOCAL_CONFIG)
-       clientConfig, err := deployers.NewWhiskConfig(defaultPath, 
deploymentPath, manifestPath, false)
+       clientConfig, err := deployers.NewWhiskConfig(defaultPath, 
deploymentPath, manifestPath)
        if err != nil {
                return nil, err
        }
diff --git a/utils/flags.go b/utils/flags.go
index 9232fc0..6ecae60 100644
--- a/utils/flags.go
+++ b/utils/flags.go
@@ -34,7 +34,7 @@ type WskDeployFlags struct {
        ProjectPath      string
        DeploymentPath   string
        ManifestPath     string
-       UseInteractive   bool
+       Preview          bool
        Strict           bool // strict flag to support user defined runtime 
version.
        Key              string
        Cert             string
diff --git a/utils/misc.go b/utils/misc.go
index 1e4196a..3ffe17e 100644
--- a/utils/misc.go
+++ b/utils/misc.go
@@ -19,22 +19,20 @@ package utils
 
 import (
        "archive/zip"
-       "bufio"
        "errors"
        "fmt"
-       "io"
-       "os"
-       "os/user"
-       "path/filepath"
-       "reflect"
-       "strings"
-
        "github.com/apache/incubator-openwhisk-client-go/whisk"
        "github.com/apache/incubator-openwhisk-wskdeploy/wski18n"
        "github.com/hokaccha/go-prettyjson"
+       "io"
        "io/ioutil"
        "net/http"
+       "os"
+       "os/user"
        "path"
+       "path/filepath"
+       "reflect"
+       "strings"
 )
 
 const (
@@ -102,19 +100,6 @@ func PrettyJSON(j interface{}) (string, error) {
        return string(bytes), nil
 }
 
-// Common utilities
-
-// Prompt for user input
-func Ask(reader *bufio.Reader, question string, def string) string {
-       fmt.Print(question + " (" + def + "): ")
-       answer, _ := reader.ReadString('\n')
-       len := len(answer)
-       if len == 1 {
-               return def
-       }
-       return answer[:len-1]
-}
-
 var kindToJSON []string = []string{"", "boolean", "integer", "integer", 
"integer", "integer", "integer", "integer", "integer", "integer",
        "integer", "integer", "integer", "number", "number", "number", 
"number", "array", "", "", "", "object", "", "", "string", "", ""}
 
diff --git a/wski18n/i18n_ids.go b/wski18n/i18n_ids.go
index 1c081b9..12807b5 100644
--- a/wski18n/i18n_ids.go
+++ b/wski18n/i18n_ids.go
@@ -98,7 +98,7 @@ const (
        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_PREVIEW     = "msg_cmd_flag_preview"
        ID_CMD_FLAG_KEY_FILE    = "msg_cmd_flag_key_file"
        ID_CMD_FLAG_MANAGED     = "msg_cmd_flag_allow_managed"
        ID_CMD_FLAG_PROJECTNAME = "msg_cmd_flag_project_name"
@@ -154,13 +154,6 @@ const (
        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_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"
-
        // Errors
        ID_ERR_DEPENDENCY_UNKNOWN_TYPE                                   = 
"msg_err_dependency_unknown_type"
        ID_ERR_ENTITY_CREATE_X_key_X_err_X_code_X                        = 
"msg_err_entity_create"
@@ -229,7 +222,7 @@ var I18N_ID_SET = [](string){
        ID_CMD_FLAG_CONFIG,
        ID_CMD_FLAG_DEFAULTS,
        ID_CMD_FLAG_DEPLOYMENT,
-       ID_CMD_FLAG_INTERACTIVE,
+       ID_CMD_FLAG_PREVIEW,
        ID_CMD_FLAG_KEY_FILE,
        ID_CMD_FLAG_MANAGED,
        ID_CMD_FLAG_MANIFEST,
@@ -285,11 +278,6 @@ var I18N_ID_SET = [](string){
        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_PROMPT_UNDEPLOY,
        ID_MSG_UNDEPLOYMENT_CANCELLED,
        ID_MSG_UNDEPLOYMENT_FAILED,
        ID_MSG_UNDEPLOYMENT_SUCCEEDED,
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index 0d5bd79..b9ffde5 100644
--- a/wski18n/i18n_resources.go
+++ b/wski18n/i18n_resources.go
@@ -92,12 +92,12 @@ func wski18nResourcesDe_deAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
 
-var _wski18nResourcesEn_usAllJson = 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5b\x6d\x8f\xdb\xb6\xb2\xfe\x9e\x5f\x31\x08\x2e\x90\x16\x70\x94\xb4\x17\x17\xb8\x08\xb0\x38\xc8\x69\xd2\x76\x4f\x9b\x6c\xb0\x9b\x9c\xa0\x48\x17\x0a\x2d\x8e\x6d\xd6\x12\x29\x90\x94\x1d\xd7\xf0\x7f\x3f\x18\xbe\x48\xb2\x77\x29\x69\x9d\x16\x27\x5f\xea\x86\xc3\x99\x67\x86\xe4\xc3\x99\xa1\xf2\xe9\x11\xc0\xfe\x11\x00\xc0\x63\xc1\x1f\xbf\x80\xc7\x95\x59\xe6\xb5\xc6\x85\xf8\x92\xa3\xd6\x4a\x3f\x9e\xf9\x51\xab
 [...]
+var _wski18nResourcesEn_usAllJson = 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5b\x5f\x8f\xdb\x36\x12\x7f\xcf\xa7\x18\x04\x07\xa4\x05\x1c\x25\xed\xe1\x80\x43\x80\x7d\xc8\x35\x69\xbb\xd7\x26\x1b\xec\x26\x17\x14\xb9\x85\x42\x8b\x63\x9b\xb5\x44\x0a\x24\x65\xc7\x35\xfc\xdd\x0f\xc3\x3f\x92\xec\x5d\x4a\x5a\xa7\xc5\xe5\xa5\x6e\x38\x9c\xf9\xcd\x90\xfc\x71\x66\xa8\x7c\x7a\x04\xb0\x7f\x04\x00\xf0\x58\xf0\xc7\x2f\xe0\x71\x65\x96\x79\xad\x71\x21\xbe\xe4\xa8\xb5\xd2\x8f\x67\x7e\xd4\x6a\x26
 [...]
 
 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: 
14092, mode: os.FileMode(438), modTime: time.Unix(1520952786, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 
13551, mode: os.FileMode(420), modTime: time.Unix(1521501471, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -132,7 +132,7 @@ func wski18nResourcesEs_esAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -152,7 +152,7 @@ func wski18nResourcesFr_frAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size: 
101, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size: 
101, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -172,7 +172,7 @@ func wski18nResourcesIt_itAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -192,7 +192,7 @@ func wski18nResourcesJa_jaAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -212,7 +212,7 @@ func wski18nResourcesKo_krAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -232,7 +232,7 @@ func wski18nResourcesPt_brAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size: 
0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size: 
0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -252,7 +252,7 @@ func wski18nResourcesZh_hansAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json", 
size: 0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json", 
size: 0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
@@ -272,7 +272,7 @@ func wski18nResourcesZh_hantAllJson() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json", 
size: 0, mode: os.FileMode(438), modTime: time.Unix(1517928990, 0)}
+       info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json", 
size: 0, mode: os.FileMode(420), modTime: time.Unix(1520374115, 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 6d3cabf..512d758 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -64,8 +64,8 @@
     "translation": "path to deployment file"
   },
   {
-    "id": "msg_cmd_flag_interactive",
-    "translation": "allow interactive prompts"
+    "id": "msg_cmd_flag_preview",
+    "translation": "show deployment/undeployment plan"
   },
   {
     "id": "msg_cmd_flag_key_file",
@@ -220,26 +220,6 @@
     "translation": "Deleting {{.key}} [{{.name}}] which was removed from the 
current managed project [{{.project}}] as part of undeployment.\n"
   },
   {
-    "id": "msg_prompt_apihost",
-    "translation": "\nPlease provide the hostname for OpenWhisk: "
-  },
-  {
-    "id": "msg_prompt_authkey",
-    "translation": "\nPlease provide an authentication token: "
-  },
-  {
-    "id": "msg_prompt_deploy",
-    "translation": "Do you really want to deploy this? (y/N): "
-  },
-  {
-    "id": "msg_prompt_namespace",
-    "translation": "\nPlease provide a namespace [default value is guest]: "
-  },
-  {
-    "id": "msg_prompt_undeploy",
-    "translation": "Do you really want to undeploy this? (y/N): "
-  },
-  {
     "id": "msg_default_package",
     "translation": "Package name default is reserved, all OpenWhisk entities 
under default package are deployed/undeployed directly under your namespace."
   },

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to