Permalink
Browse files

Merge "Add Release and Stemcell info to `bosh deployments`"

  • Loading branch information...
2 parents 9ec3c36 + dd2d592 commit c751a99aef5db952964c2472b1c244f911d4a3f6 @oppegard oppegard committed with Gerrit Code Review Oct 9, 2012
Showing with 23 additions and 3 deletions.
  1. +23 −3 cli/lib/cli/commands/deployment.rb
@@ -195,9 +195,29 @@ def list
err("No deployments") if deployments.empty?
deployments_table = table do |t|
- t.headings = %w(Name)
- deployments.each do |r|
- t << [r["name"]]
+ t.headings = %w(Name Release(s) Stemcell(s))
+ deployments.each do |d|
+ deployment = director.get_deployment(d["name"])
+
+ row = if (deployment["manifest"])
+ manifest = YAML.load(deployment["manifest"])
+
+ stemcells = manifest["resource_pools"].map { |rp|
+ rp["stemcell"].values_at("name", "version").join("/")
+ }.sort.uniq
+
+ releases = manifest["releases"] || [manifest["release"]]
+ releases = releases.map { |rl|
+ rl.values_at("name", "version").join("/")
+ }.sort
+
+ [manifest["name"], releases.join("\n"), stemcells.join("\n")]
+ else
+ [d["name"], "n/a", "n/a"]
+ end
+
+ t.add_row(row)
+ t.add_separator unless d == deployments.last
end
end

0 comments on commit c751a99

Please sign in to comment.