Sha256: 536d9ea910fd076c5207e5d5da6fd58f625c6c57b7f5ced81f65fb4f82a830ae
Contents?: true
Size: 742 Bytes
Versions: 3
Compression:
Stored size: 742 Bytes
Contents
# frozen_string_literal: true require 'fog-packet' require 'log4r' require 'pp' module VagrantPlugins module Packet module Action # This action connects to Packet, verifies credentials work, and # puts the Packet connection object into the `:packet_compute` key # in the environment. class ConnectPacket def initialize(app, _env) @app = app @logger = Log4r::Logger.new('vagrant_packet::action::connect_packet') end def call(env) @logger.info('Connecting to Packet...') env[:packet_compute] = Fog::Compute::Packet.new(packet_token: env[:machine].provider_config.packet_token) @app.call(env) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems