Skip to content

Commit

Permalink
Don't set network_ids when @networks.map(&:id).compact.join(,) result…
Browse files Browse the repository at this point in the history
…s in an empty string, which is the case when using basic networking
  • Loading branch information
hrak committed Dec 21, 2016
1 parent e6506c4 commit 6a822b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/vagrant-cloudstack/action/run_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ def create_vm
:image_id => @template.id
}

options['network_ids'] = @networks.map(&:id).compact.join(",") unless @networks.empty?
unless @networks.empty?
nets = @networks.map(&:id).compact.join(",")
options['network_ids'] = nets unless nets.empty?
end
options['security_group_ids'] = @security_groups.map{|security_group| security_group.id}.join(',') unless @security_groups.empty?
options['project_id'] = @domain_config.project_id unless @domain_config.project_id.nil?
options['key_name'] = @domain_config.keypair unless @domain_config.keypair.nil?
Expand Down

0 comments on commit 6a822b1

Please sign in to comment.