You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/04/27 13:01:42 UTC

[1/2] brooklyn-client git commit: Add check that path is not empty.

Repository: brooklyn-client
Updated Branches:
  refs/heads/master c74557918 -> 6d5574af6


Add check that path is not empty.

This avoids a panic in a case like br catalog add file://test.zip,
if you forget to add the path to the file, file:///some/path/test.zip.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/aeb87722
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/aeb87722
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/aeb87722

Branch: refs/heads/master
Commit: aeb877223cb3c67ad7f9fc25cd3cef25800f8db7
Parents: c745579
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Thu Apr 27 10:45:41 2017 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Thu Apr 27 10:47:35 2017 +0100

----------------------------------------------------------------------
 cli/api/catalog/catalog.go | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/aeb87722/cli/api/catalog/catalog.go
----------------------------------------------------------------------
diff --git a/cli/api/catalog/catalog.go b/cli/api/catalog/catalog.go
index 5cfefc3..7a422e2 100644
--- a/cli/api/catalog/catalog.go
+++ b/cli/api/catalog/catalog.go
@@ -233,8 +233,12 @@ func AddCatalog(network *net.Network, resource string) (map[string]models.Catalo
 
 	if "" == u.Scheme || "file" == u.Scheme {
                 if "file" == u.Scheme {
+			if u.Path == "" {
+				return nil, errors.New("No resource in 'file:' URL: " + resource)
+			}
                         resource = u.Path
                 }
+
 		file, err := os.Open(filepath.Clean(resource))
 		if err != nil {
 			return nil, err


[2/2] brooklyn-client git commit: Closes #49

Posted by ge...@apache.org.
Closes #49

Add check that path is not empty.

This avoids a panic in a case like br catalog add file://test.zip,
if you forget to add the path to the file, file:///some/path/test.zip.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/6d5574af
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/6d5574af
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/6d5574af

Branch: refs/heads/master
Commit: 6d5574af657f4f544f0cac8ddd0c32d279ff6d68
Parents: c745579 aeb8772
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Thu Apr 27 14:01:26 2017 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Thu Apr 27 14:01:26 2017 +0100

----------------------------------------------------------------------
 cli/api/catalog/catalog.go | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------