Skip to content

Commit

Permalink
[CHEF-2311] special case EC2 to show the public IP
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed May 6, 2011
1 parent 52ab7df commit 2c194b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chef/lib/chef/knife/core/node_presenter.rb
Expand Up @@ -60,14 +60,17 @@ class NodePresenter < GenericPresenter
def summarize(data)
if data.kind_of?(Chef::Node)
node = data
# special case ec2 with their split horizon whatsis.
ip = (node[:ec2] && node[:ec2][:public_ipv4]) || node[:ipaddress]

summarized=<<-SUMMARY
#{ui.color('Node Name:', :bold)} #{ui.color(node.name, :bold)}
#{key('Environment:')} #{node.chef_environment}
#{key('FQDN:')} #{node[:fqdn]}
#{key('IP:')} #{node[:ipaddress]}
#{key('IP:')} #{ip}
#{key('Run List:')} #{node.run_list}
#{key('Roles:')} #{Array(node[:roles]).join(', ')}
#{key('Recipes')} #{Array(node[:recipes]).join(', ')}
#{key('Recipes:')} #{Array(node[:recipes]).join(', ')}
#{key('Platform:')} #{node[:platform]} #{node[:platform_version]}
SUMMARY
if config[:medium_output] || config[:long_output]
Expand Down

0 comments on commit 2c194b1

Please sign in to comment.