Update docker network action to auto-generate cli flags
This commit updates the docker network behavior to auto-generate the docker network command flags from Vagrants network config option.
This commit is contained in:
parent
b5a092397f
commit
4a0f1a0a33
|
@ -45,16 +45,16 @@ module VagrantPlugins
|
||||||
def parse_cli_arguments(options)
|
def parse_cli_arguments(options)
|
||||||
cli_opts = {create: [], connect: []}
|
cli_opts = {create: [], connect: []}
|
||||||
|
|
||||||
# make this a function that generates the proper flags
|
# Splits the networking options to generate the proper CLI flags for docker
|
||||||
if options[:type] != "dhcp"
|
if options[:type] != "dhcp"
|
||||||
if options[:docker__subnet]
|
options.each do |opt, value|
|
||||||
cli_opts[:create].concat(["--subnet", options[:docker__subnet]])
|
vals = opt.to_s.split("__")
|
||||||
end
|
if vals[0] == "docker" && vals.size == 3
|
||||||
|
cli_opts[vals[1].to_sym].concat(["--#{vals[2]}", value])
|
||||||
if options[:docker__ip]
|
end
|
||||||
cli_opts[:connect].concat(["--ip", options[:docker__ip]])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return cli_opts
|
return cli_opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue