Custom merging behavior for VM configuration

This commit is contained in:
Mitchell Hashimoto 2012-01-11 21:35:09 -08:00
parent 51353d51fc
commit b7279ec79d
1 changed files with 11 additions and 0 deletions

View File

@ -28,6 +28,17 @@ module Vagrant
@customizations = []
end
# Custom merge method since some keys here are merged differently.
def merge(other)
result = super
result.forwarded_ports = @forwarded_ports + other.forwarded_ports
result.shared_folders = @shared_folders.merge(other.shared_folders)
result.networks = @networks + other.networks
result.provisioners = @provisioners + other.provisioners
result.customizations = @customizations + other.customizations
result
end
def forward_port(guestport, hostport, options=nil)
if !guestport.kind_of?(Integer)
raise Errors::DeprecationError, :message => <<-MESSAGE