brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-client git commit: Only output location details when the app has a location
Date Tue, 25 Oct 2016 19:19:14 GMT
Repository: brooklyn-client
Updated Branches:
  refs/heads/master 5dd174649 -> ba2037e06


Only output location details when the app has a location

Fixes https://issues.apache.org/jira/browse/BROOKLYN-230


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

Branch: refs/heads/master
Commit: bcc1360690cefb4b677a9556117e6d3400dac71d
Parents: ff8224c
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Mon Oct 24 17:40:53 2016 +0100
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Mon Oct 24 17:40:53 2016 +0100

----------------------------------------------------------------------
 cli/commands/application.go | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/bcc13606/cli/commands/application.go
----------------------------------------------------------------------
diff --git a/cli/commands/application.go b/cli/commands/application.go
index c321227..4156cb8 100644
--- a/cli/commands/application.go
+++ b/cli/commands/application.go
@@ -79,10 +79,6 @@ func (cmd *Application) show(appName string) {
 	if nil != err {
 		error_handler.ErrorExit(err)
 	}
-	location, err := locations.GetLocation(cmd.network, application.Spec.Locations[0])
-	if nil != err {
-		error_handler.ErrorExit(err)
-	}
 	table := terminal.NewTable([]string{"Id:", application.Id})
 	table.Add("Name:", application.Spec.Name)
 	table.Add("Status:", string(application.Status))
@@ -91,10 +87,16 @@ func (cmd *Application) show(appName string) {
 	}
 	table.Add("Type:", application.Spec.Type)
 	table.Add("CatalogItemId:", entity.CatalogItemId)
-	table.Add("LocationId:", strings.Join(application.Spec.Locations, ", "))
-	table.Add("LocationName:", location.Name)
-	table.Add("LocationSpec:", location.Spec)
-	table.Add("LocationType:", location.Type)
+	if len(application.Spec.Locations) > 0 {
+		table.Add("LocationId:", strings.Join(application.Spec.Locations, ", "))
+		location, err := locations.GetLocation(cmd.network, application.Spec.Locations[0])
+		if nil != err {
+			error_handler.ErrorExit(err)
+		}
+		table.Add("LocationName:", location.Name)
+		table.Add("LocationSpec:", location.Spec)
+		table.Add("LocationType:", location.Type)
+	}
 	table.Print()
 }
 


Mime
View raw message