You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/08/07 16:13:38 UTC

[GitHub] dubeejw commented on a change in pull request #2424: (Review) Leading Slash (CLI issue #2328)

dubeejw commented on a change in pull request #2424: (Review) Leading Slash (CLI issue #2328)
URL: https://github.com/apache/incubator-openwhisk/pull/2424#discussion_r131698077
 
 

 ##########
 File path: tools/cli/go-whisk-cli/commands/util.go
 ##########
 @@ -140,29 +134,21 @@ func getNamespace() (string) {
     return namespace
 }
 
-/*
-Return a fully qualified name given a (possibly fully qualified) resource name and optional namespace.
+func parseQualifiedNameError(entityName string, err error) (error) {
+    whisk.Debug(whisk.DbgError, "parseQualifiedName(%s) failed: %s\n", entityName, err)
 
-Examples:
-      (foo, None) => /_/foo
-      (pkg/foo, None) => /_/pkg/foo
-      (foo, ns) => /ns/foo
-      (/ns/pkg/foo, None) => /ns/pkg/foo
-      (/ns/pkg/foo, otherns) => /ns/pkg/foo
-*/
-func getQualifiedName(name string, namespace string) (string) {
-    if strings.HasPrefix(name, "/") {
-        return name
-    } else if strings.HasPrefix(namespace, "/")  {
-        return fmt.Sprintf("%s/%s", namespace, name)
-    } else {
-        if len(namespace) == 0 {
-            namespace = Properties.Namespace
-        }
-        return fmt.Sprintf("/%s/%s", namespace, name)
-    }
+    errMsg := wski18n.T(
+        "'{{.name}}' is not a valid qualified name: {{.err}}",
+        map[string]interface{}{
+            "name": entityName,
+            "err": err,
+        })
+
+    return whisk.MakeWskError(errors.New(errMsg), whisk.EXITCODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
 }
 
+// END OF TODO: DELETE BLOCK***************************************************
 
 Review comment:
   ???
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services