brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geom...@apache.org
Subject [4/6] brooklyn-client git commit: correctly handle file:// urls
Date Thu, 27 Apr 2017 09:44:50 GMT
correctly handle file:// urls


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

Branch: refs/heads/master
Commit: 8f178805661b93dd2fb28f3ac91e7c575f1427b9
Parents: 9f4224d
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Mon Apr 24 14:02:28 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Mon Apr 24 15:13:30 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/8f178805/cli/api/catalog/catalog.go
----------------------------------------------------------------------
diff --git a/cli/api/catalog/catalog.go b/cli/api/catalog/catalog.go
index 0928590..bbd7bf6 100644
--- a/cli/api/catalog/catalog.go
+++ b/cli/api/catalog/catalog.go
@@ -228,11 +228,14 @@ func AddCatalog(network *net.Network, resource string) (map[string]models.Catalo
 	}
 
 	//Only deal with the below file types
-	if "" != u.Scheme && "file" != u.Scheme  && "http" != u.Scheme &&
"https" != u.Scheme{
+	if "" != u.Scheme && "file" != u.Scheme  && "http" != u.Scheme &&
"https" != u.Scheme {
 		return nil, errors.New("Unrecognised protocol scheme: " + u.Scheme)
 	}
 
 	if "" == u.Scheme || "file" == u.Scheme {
+                if "file" == u.Scheme {
+                        resource = u.Path
+                }
 		file, err := os.Open(filepath.Clean(resource))
 		if err != nil {
 			return nil, err


Mime
View raw message