Class: Chef::Knife::ClusterStop

Inherits:
Ironfan::Script show all
Defined in:
lib/chef/knife/cluster_stop.rb

Instance Attribute Summary

Attributes included from Ironfan::KnifeCommon

#broker, #problems

Instance Method Summary collapse

Methods inherited from Ironfan::Script

#_run, #aggregates_on_noop?, #prepares_on_noop?

Methods included from Ironfan::KnifeCommon

#all_computers, #bootstrapper, #configure_dry_run, #confirm_or_exit, #die, #discover_computers, #display, #exit_if_unhealthy!, #gemfile, #get_relevant_slice, #get_slice, #has_problem, #healthy?, included, load_deps, #load_ironfan, #pick_apart, #predicate_str, #progressbar_for_threads, #run, #run_bootstrap, #section, #sub_command, #wait_for_ssh

Instance Method Details

#aggregates?Boolean

Returns:

  • (Boolean)


44
# File 'lib/chef/knife/cluster_stop.rb', line 44

def aggregates?() false   end

#confirm_execution(target) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/chef/knife/cluster_stop.rb', line 34

def confirm_execution(target)
  ui.info "  Unless these nodes are backed by EBS volumes, this will result in loss of all data"
  ui.info "  not saved elsewhere. Even if they are EBS backed, there may still be some data loss."
  if target.any?(&:permanent?)
    ui.warn "These servers are marked as 'permanent=true': #{ui.color(target.select(&:permanent?).map(&:name).join('.'), :red)}"
  end
  confirm_or_exit("Are you absolutely certain that you want to perform this action? (Type 'Yes' to confirm) ", 'Yes')
end

#perform_execution(target) ⇒ Object



29
30
31
32
# File 'lib/chef/knife/cluster_stop.rb', line 29

def perform_execution(target)
  section("Stopping computers")
  super(target)
end

#prepares?Boolean

Returns:

  • (Boolean)


43
# File 'lib/chef/knife/cluster_stop.rb', line 43

def prepares?()   false   end

#relevant?(computer) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/chef/knife/cluster_stop.rb', line 25

def relevant?(computer)
  (not computer.bogus?) && computer.running?
end