Issue #8402 has been updated by Jeff McCune.

Status changed from Accepted to In Topic Branch Pending Merge

# Addressed James' feedback #

Still needs a review.  This patch adds prettier output:

<pre>
>From e0f5ab860dd66e8f4de6c37fa57fa4e97e14b423 Mon Sep 17 00:00:00 2001
From: Jeff McCune <[email protected]>
Date: Thu, 14 Jul 2011 18:14:05 -0700
Subject: [PATCH/Module/cloudpack 2/2] (#8402) Add console rendering hook for
 prettiness

This change adds a console rendering hook that makes the default console
output a bit more pretty.  This is based on feedback from James and help
from Daniel.

Signed-off-by: Jeff McCune <[email protected]>
---

This addition is based on feedback from James Turnbull that we should support
prettier output.  The default output now looks like:

    i-5f4cb23e:
      created_at: Thu Jul 14 23:56:25 UTC 2011
      dns_name: ec2-50-19-131-109.compute-1.amazonaws.com
      id: i-5f4cb23e
      state: running
    i-614fb100:
      created_at: Thu Jul 14 23:55:39 UTC 2011
      dns_name: ec2-50-16-55-54.compute-1.amazonaws.com
      id: i-614fb100
      state: running

 lib/puppet/face/node/list.rb |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/face/node/list.rb b/lib/puppet/face/node/list.rb
index 1699068..679399d 100644
--- a/lib/puppet/face/node/list.rb
+++ b/lib/puppet/face/node/list.rb
@@ -12,6 +12,13 @@ Puppet::Face.define :node, '0.0.1' do
     when_invoked do |options|
       Puppet::CloudPack.list(options)
     end
+    when_rendering :console do |value|
+      value.collect do |id,status_hash|
+        "#{id}:\n" + status_hash.collect do |field, val|
+          "  #{field}: #{val}"
+        end.sort.join("\n")
+      end.sort.join("\n")
+    end
   end
 end
 
-- 
1.7.5.4

</pre>
----------------------------------------
Bug #8402: List action should display status
https://projects.puppetlabs.com/issues/8402

Author: Jeff McCune
Status: In Topic Branch Pending Merge
Priority: Normal
Assignee: Jeff McCune
Category: cloudpack
Target version: 0.6.0
Keywords: list action status
Branch: ticket/master/8402_list_should_display_status


Based on the feedback from the demo, the list action for cloudnode should 
display the instance status.  For example, the following output is "bad" 
because it displays null values for terminated instances:

<pre>
➜  cloudpack git:(ticket/master/bigmerge_improve_actions_for_end_user) puppet 
cloudnode list --render-as yaml
--- 
  - 
  -
</pre>

I think at a minimum we should display the instance ID, public dns name if 
available, and status of the instance.  e.g. "terminated" "running" "shutting 
down" etc...



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to