Raise proper class if invalid options given for docker network
This commit is contained in:
parent
0b28580105
commit
a1b48ed1bb
|
@ -64,8 +64,7 @@ module VagrantPlugins
|
||||||
elsif options[:type] == "dhcp"
|
elsif options[:type] == "dhcp"
|
||||||
network_name = "vagrant_network"
|
network_name = "vagrant_network"
|
||||||
else
|
else
|
||||||
# TODO: Make this an error class
|
raise Errors::NetworkInvalidOption, container: machine.name
|
||||||
raise "Must specify a `subnet` or use `dhcp`"
|
|
||||||
end
|
end
|
||||||
container_id = machine.id
|
container_id = machine.id
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,10 @@ module VagrantPlugins
|
||||||
error_key(:docker_provider_nfs_without_privileged)
|
error_key(:docker_provider_nfs_without_privileged)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class NetworkInvalidOption < DockerError
|
||||||
|
error_key(:network_invalid_option)
|
||||||
|
end
|
||||||
|
|
||||||
class PackageNotSupported < DockerError
|
class PackageNotSupported < DockerError
|
||||||
error_key(:package_not_supported)
|
error_key(:package_not_supported)
|
||||||
end
|
end
|
||||||
|
|
|
@ -197,6 +197,9 @@ en:
|
||||||
is functional and properly configured.
|
is functional and properly configured.
|
||||||
|
|
||||||
Host VM ID: %{id}
|
Host VM ID: %{id}
|
||||||
|
network_invalid_option: |-
|
||||||
|
Invalid option given for docker network for guest "%{container}". Must specify either
|
||||||
|
a `subnet` or use `type: "dhcp"`.
|
||||||
package_not_supported: |-
|
package_not_supported: |-
|
||||||
The "package" command is not supported with the Docker provider.
|
The "package" command is not supported with the Docker provider.
|
||||||
If you'd like to commit or push your Docker container, please SSH
|
If you'd like to commit or push your Docker container, please SSH
|
||||||
|
|
Loading…
Reference in New Issue