providers/docker: better error on suspend

This commit is contained in:
Mitchell Hashimoto 2015-07-08 10:18:43 -06:00
parent 6e3e01bd59
commit 855aa66ad9
3 changed files with 15 additions and 0 deletions

View File

@ -283,6 +283,12 @@ module VagrantPlugins
end end
end end
def self.action_suspend
lambda do |env|
raise Errors::SuspendNotSupported
end
end
# The autoload farm # The autoload farm
action_root = Pathname.new(File.expand_path("../action", __FILE__)) action_root = Pathname.new(File.expand_path("../action", __FILE__))
autoload :Build, action_root.join("build") autoload :Build, action_root.join("build")

View File

@ -37,6 +37,10 @@ module VagrantPlugins
error_key(:state_stopped) error_key(:state_stopped)
end end
class SuspendNotSupported < DockerError
error_key(:suspend_not_supported)
end
class SyncedFolderNonDocker < DockerError class SyncedFolderNonDocker < DockerError
error_key(:synced_folder_non_docker) error_key(:synced_folder_non_docker)
end end

View File

@ -185,6 +185,11 @@ en:
d.remains_running = false d.remains_running = false
end end
suspend_not_supported: |-
The "suspend" command is not supported with the Docker provider.
Docker containers don't natively support suspend. If you're using
a host machine, you can suspend the host machine by finding it
in `vagrant global-status` and using `vagrant suspend <id>`.
synced_folder_non_docker: |- synced_folder_non_docker: |-
The "docker" synced folder type can't be used because the provider The "docker" synced folder type can't be used because the provider
in use is not Docker. This synced folder type only works with the in use is not Docker. This synced folder type only works with the