Sha256: 53d0a9cdadf41707e5877198399ccf6c0da6f910551d751a04054eba76a5e774

Contents?: true

Size: 705 Bytes

Versions: 3

Compression:

Stored size: 705 Bytes

Contents

require "log4r"
require 'vagrant-xhyve/util/vagrant-xhyve'

module VagrantPlugins
  module XHYVE
    module Action
      # This action reads the SSH info for the machine and puts it into the
      # `:machine_ssh_info` key in the environment.
      class ReadSSHInfo
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_xhyve::action::read_ssh_info")
        end

        def call(env)
          env[:machine_ssh_info] = read_ssh_info(env)
          @app.call(env)
        end

        def read_ssh_info(env)
          xhyve_status = env[:xhyve_status]
          return { :host => xhyve_status[:ip], :port => 22 }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-xhyve-0.4.1 lib/vagrant-xhyve/action/read_ssh_info.rb
vagrant-xhyve-0.4.0 lib/vagrant-xhyve/action/read_ssh_info.rb
vagrant-xhyve-0.3.0 lib/vagrant-xhyve/action/read_ssh_info.rb