Sha256: b331c946d12fdd25e2b64d61ddb699380c628e9e3078370b3c0a245e2cdf679e

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 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, stringio=nil)
        @started = true
        @completed = false
             
        @connection.on_complete(lambda { set_completed(true) })
        @connection.on_failure(lambda { set_failure(true) })
    
        Thread.new {
          @connection.execute(commands, stringio)
        }
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
egon-0.4.0 lib/egon/undercloud/installer.rb
egon-0.3.6 lib/egon/undercloud/installer.rb
egon-0.3.5 lib/egon/undercloud/installer.rb