Skip to content

Commit

Permalink
Feature flip provisioner's meta-args
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiamarchi committed Apr 30, 2016
1 parent e900648 commit e124de0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/vagrant-openstack-provider/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def self.action_provision
if env[:machine_state_id] == :not_created
b2.use Message, I18n.t('vagrant_openstack.not_created')
else
b2.use ProvisionWrapper
if env[:machine].provider_config.meta_args_support
b2.use ProvisionWrapper
else
b2.use Provision
end
b2.use SyncFolders
end
end
Expand Down Expand Up @@ -100,7 +104,13 @@ def self.action_up
case env[:machine_state_id]
when :not_created
ssh_disabled = env[:machine].provider_config.ssh_disabled
b2.use ProvisionWrapper unless ssh_disabled
unless ssh_disabled
if env[:machine].provider_config.meta_args_support
b2.use ProvisionWrapper
else
b2.use Provision
end
end
b2.use SyncFolders
b2.use CreateStack
b2.use CreateServer
Expand Down
6 changes: 6 additions & 0 deletions lib/vagrant-openstack-provider/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ class Config < Vagrant.plugin('2', :config)
# @return [HttpConfig]
attr_accessor :http

#
# @return [Boolean]
attr_accessor :meta_args_support

def initialize
@password = UNSET_VALUE
@openstack_compute_url = UNSET_VALUE
Expand Down Expand Up @@ -236,6 +240,7 @@ def initialize
@server_delete_timeout = UNSET_VALUE
@stack_create_timeout = UNSET_VALUE
@stack_delete_timeout = UNSET_VALUE
@meta_args_support = UNSET_VALUE
@http = HttpConfig.new
end

Expand Down Expand Up @@ -320,6 +325,7 @@ def finalize!
@server_delete_timeout = 200 if @server_delete_timeout == UNSET_VALUE
@stack_create_timeout = 200 if @stack_create_timeout == UNSET_VALUE
@stack_delete_timeout = 200 if @stack_delete_timeout == UNSET_VALUE
@meta_args_support = false if @meta_args_support == UNSET_VALUE
@networks = nil if @networks.empty?
@volumes = nil if @volumes.empty?
@stacks = nil if @stacks.empty?
Expand Down

0 comments on commit e124de0

Please sign in to comment.