Class: Bosh::Director::Stopper
Instance Method Summary collapse
-
#initialize(instance_plan, target_state, config, logger) ⇒ Stopper
constructor
A new instance of Stopper.
- #stop ⇒ Object
Constructor Details
#initialize(instance_plan, target_state, config, logger) ⇒ Stopper
Returns a new instance of Stopper.
3 4 5 6 7 8 9 |
# File 'lib/bosh/director/stopper.rb', line 3 def initialize(instance_plan, target_state, config, logger) @instance_plan = instance_plan @instance_model = @instance_plan.new? ? instance_plan.instance.model : instance_plan.existing_instance @target_state = target_state @config = config @logger = logger end |
Instance Method Details
#stop ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bosh/director/stopper.rb', line 11 def stop return if @instance_model.compilation || @instance_model.vm_cid.nil? if @instance_plan.skip_drain @logger.info("Skipping drain for '#{@instance_model}'") else perform_drain end agent_client.stop end |