openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 03/16: Clarify WSK_CONFIG_FILE empty string behavior (#2357)
Date Mon, 18 Sep 2017 14:55:31 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 326ffdbcceafd685067e2b1613237349c644d6ef
Author: Mark Deuser <mdeuser@us.ibm.com>
AuthorDate: Thu Sep 14 12:37:21 2017 -0400

    Clarify WSK_CONFIG_FILE empty string behavior (#2357)
    
    - add test and add comments.
---
 commands/property.go | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/commands/property.go b/commands/property.go
index d3476fd..d51fdeb 100644
--- a/commands/property.go
+++ b/commands/property.go
@@ -402,8 +402,11 @@ func SetDefaultProperties() {
 func GetPropertiesFilePath() (propsFilePath string, werr error) {
     var envExists bool
 
-    // Environment variable overrides the default properties file path
-    if propsFilePath, envExists = os.LookupEnv("WSK_CONFIG_FILE"); envExists == true || propsFilePath
!= "" {
+    // WSK_CONFIG_FILE environment variable overrides the default properties file path
+    // NOTE: If this variable is set to an empty string or non-existent/unreadable file
+    // - any existing $HOME/.wskprops is ignored
+    // - a default configuration is used
+    if propsFilePath, envExists = os.LookupEnv("WSK_CONFIG_FILE"); envExists {
         whisk.Debug(whisk.DbgInfo, "Using properties file '%s' from WSK_CONFIG_FILE environment
variable\n", propsFilePath)
         return propsFilePath, nil
     } else {

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

Mime
View raw message