Class: Chef::Knife::ClusterShow

Inherits:
Chef::Knife show all
Includes:
ClusterChef::KnifeCommon
Defined in:
lib/chef/knife/cluster_show.rb

Instance Method Summary collapse

Methods included from ClusterChef::KnifeCommon

#bootstrapper, #configure_dry_run, #confirm_execution, #confirm_or_exit, #die, #display, #get_relevant_slice, #get_slice, included, #load_cluster_chef, load_deps, #predicate_str, #progressbar_for_threads, #relevant?, #run_bootstrap, #section, #sub_command

Instance Method Details

#runObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/chef/knife/cluster_show.rb', line 36

def run
  load_cluster_chef
  die(banner) if @name_args.empty?
  configure_dry_run

  # Load the cluster/facet/slice/whatever
  target = get_slice(* @name_args)

  #
  # Dump entire contents of objects if -VV flag given
  #
  if config[:verbosity] >= 2
    target.each do |svr|
      Chef::Log.debug( "Server #{svr.name}: #{JSON.pretty_generate(svr.to_hash)}" )
      Chef::Log.debug( "- cloud: #{JSON.pretty_generate(svr.cloud.to_hash)}" )
      Chef::Log.debug( "- fog:   #{JSON.pretty_generate(svr.fog_launch_description)}" )
    end
  end

  # Display same
  display(target)

end