core/rails/app/models/node_role.rb
# Commit takes us back to TODO or BLOCKED, depending
Commit takes us back to TODO or BLOCKED, depending
Commit takes us back to TODO or BLOCKED depending
def commit!(ignore_power=false)
    NodeRole.transaction do
      reload
      if deployment_role.proposed?
        raise InvalidTransition.new(self,state,PROPOSED,"Cannot commit! unless deployment_role committed!")
      end
      update!(committed_data: proposed_data) unless proposed_data.nil?
      if proposed?
        Event.fire(self, obj_class: 'role', obj_id: role.name, event: 'on_commit')
        block_or_todo
      end
      unless ignore_power
        if !node.alive && node.power[:on]
          @do_power_on = true
        else
          @do_power_on = false
        end
      else
        @do_power_on = false
      end
    end
    self
  end
def commit! ( ignore_power = false ) NodeRole . transaction do reload if deployment_role . proposed? raise InvalidTransition . new ( self , state , PROPOSED , "Cannot commit! unless deployment_role committed!" ) end update! ( committed_data : proposed_data ) unless proposed_data . nil? if proposed? Event . fire ( self , obj_class : 'role' , obj_id : role . name , event : 'on_commit' ) block_or_todo end unless ignore_power if ! node . alive && node . power [ :on ] @do_power_on = true else @do_power_on = false end else @do_power_on = false end end self end
Commit takes us back to TODO or BLOCKED, depending
Commit takes us back to TODO or BLOCKED depending
ignore_power
<not_specific>