Sha256: 95219996354565be92f0a816ca2f4c7b084db81fb898c3232162c2bb45f4d376

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

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

module VagrantPlugins
  module HYPERKIT
    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_hyperkit::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

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-hyperkit-0.4.3 lib/vagrant-hyperkit/action/read_ssh_info.rb