Sha256: 89f96ea026f45d1c9daf90cdf663c2866782ee49ecf853e3891ede6863033dc0
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
require 'rbvmomi' require 'log4r' module VagrantPlugins module VCenter module Action # This class connects the vagrant-vcenter provider to vCenter. class ConnectvCenter def initialize(app, env) @app = app @logger = Log4r::Logger.new( 'vagrant_vcenter::action::connect_vCenter') end def call(env) config = env[:machine].provider_config # Avoid recreating a new session each time. unless config.vcenter_cnx @logger.info('Connecting to vCenter...') @logger.debug("config.hostname: #{config.hostname}") @logger.debug("config.username: #{config.username}") @logger.debug("config.password: #{config.password}") # FIXME: fix the insecure flag, catch the exception config.vcenter_cnx = RbVmomi::VIM.connect( host: config.hostname, user: config.username, password: config.password, insecure: true) end @app.call env end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-vcenter-0.1.0 | lib/vagrant-vcenter/action/connect_vcenter.rb |
vagrant-vcenter-0.0.2.pre.dev | lib/vagrant-vcenter/action/connect_vcenter.rb |