brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] brooklyn-client pull request #30: br app only outputs location details when ...
Date Mon, 24 Oct 2016 17:04:37 GMT
Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-client/pull/30#discussion_r84734130
  
    --- Diff: cli/commands/application.go ---
    @@ -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 {
    --- End diff --
    
    looks good.  
    
    Might be worth iterating over the locations if there are multiple ones, something like
    ```
    for _,  loc := range application.Spec.Locations {
    	table.Add("LocationId:", loc.Id)
    	table.Add("LocationName:", loc.Name)
    	table.Add("LocationSpec:", loc.Spec)
    	table.Add("LocationType:", loc.Type)
    }
    ```
    Caveat: haven't tried this out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message