Sha256: a211c9c6f6763c845111f5bb2e6e66c1b5c3241207599f427e79cbcc83fd2e57

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

module Egon
  module Undercloud
    class Installer
      attr_reader :started
      alias_method :started?, :started
    
      def initialize(connection)
        @connection = connection
        @completed = false
        @started = false
        @failure = false
      end
      
      def completed?
        @completed
      end
    
      def set_completed(bool)
        @completed = bool
      end
    
      def failure?
        @failure
      end
    
      def set_failure(bool)
        @failure = bool
      end
    
      def install(commands)
        @started = true
        @completed = false
             
        @connection.on_complete(lambda { set_completed(true) })
        @connection.on_failure(lambda { set_failure(true) })
    
        Thread.new {
          @connection.execute(commands)
        }
      end

      def check_ports
        # closed ports 5385, 36357
        ports = [8774, 9292, 8777, 9696, 8004, 5000, 8585, 5672]
        ports.each do |p|
          if !@connection.port_open?(p)
            set_failure(true)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
egon-0.3.3 lib/egon/undercloud/installer.rb
egon-0.3.2 lib/egon/undercloud/installer.rb
egon-0.3.1 lib/egon/undercloud/installer.rb
egon-0.3.0 lib/egon/undercloud/installer.rb