lib/vanagon/engine/hardware.rb
def node_lock(hosts)
        hosts.each do |h|
          Vanagon::Driver.logger.info "Attempting  to lock #{h}."
          if @lockman.lock(h, VANAGON_LOCK_USER, "Vanagon automated lock")
            Vanagon::Driver.logger.info "Lock acquired on #{h}."
            puts "Lock acquired on #{h} for #{VANAGON_LOCK_USER}."
            return h
          end
        end
        # If they are all locked, fall back to a polling lock on last item
        polling_lock(hosts.pop)
      end
# Iterarte over the options and find a node open to lock.
Iterarte over the options and find a node open to lock.
Iterarte over the options and find a node open to lock .
def node_lock(hosts)
        hosts.each do |h|
          Vanagon::Driver.logger.info "Attempting  to lock #{h}."
          if @lockman.lock(h, VANAGON_LOCK_USER, "Vanagon automated lock")
            Vanagon::Driver.logger.info "Lock acquired on #{h}."
            puts "Lock acquired on #{h} for #{VANAGON_LOCK_USER}."
            return h
          end
        end
        polling_lock(hosts.pop)
      end
def node_lock ( hosts ) hosts . each do | h | Vanagon :: Driver . logger . info "Attempting  to lock #{h}." if @lockman . lock ( h , VANAGON_LOCK_USER , "Vanagon automated lock" ) Vanagon :: Driver . logger . info "Lock acquired on #{h}." puts "Lock acquired on #{h} for #{VANAGON_LOCK_USER}." return h end end polling_lock ( hosts . pop ) end
Iterarte over the options and find a node open to lock.
Iterarte over the options and find a node open to lock .
# If they are all locked, fall back to a polling lock on last item
hosts