Parent

Methods

Included Modules

Class/Module Index [+]

Quicksearch

Chef::Knife::ClusterPry

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/cluster_pry.rb, line 38
def run
  load_ironfan
  die(banner) if @name_args.empty?
  configure_dry_run

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

  ui.info("")
  ui.info([
      ui.color("You are in a cluster. There is a sign overhead reading '", :magenta),
      ui.color(@name_args.first, :yellow, :bold),
      ui.color("'.\nNext to you a burly man in a greasy apron sharpens his cleaver, \nand a lissom princess performs treacherous origami.", :magenta)
      ].join)
  ui.info(ui.color("It is Pitch Dark. You are likely to be eaten by a grue.", :black, :bold)) if target.select(&:running?).empty?

  # Commands to try:
  #   nn = Chef::Node.load('node-name')
  #   cluster_nodes = cluster.servers.map(&:chef_node)
  #   fog_computers  = cluster.servers.map(&:fog_server)
  #
  binding.pry
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.