Sha256: 2f050448659012e7bfddee3e6aa982d28e04851fe9859161eeab19fc245d3001
Contents?: true
Size: 756 Bytes
Versions: 3
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true require 'fog' 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