commands/rdp: execute propre capabilities

This commit is contained in:
Mitchell Hashimoto 2014-04-12 15:51:07 -07:00
parent 746b568176
commit 0fa07637f9
4 changed files with 26 additions and 1 deletions

View File

@ -21,6 +21,18 @@ module VagrantPlugins
# Execute RDP if we can
with_target_vms(argv, single_target: true) do |machine|
if !machine.communicate.ready?
raise Vagrant::Errors::VMNotCreatedError
end
if !machine.guest.capability?(:rdp_info)
raise Errors::GuestUnsupported,
name: machine.guest.name.to_s
end
@env.host.capability(
:rdp_client,
machine.guest.capability(:rdp_info))
end
end
end

View File

@ -6,6 +6,10 @@ module VagrantPlugins
error_namespace("vagrant_rdp.errors")
end
class GuestUnsupported < RDPError
error_key(:guest_unsupported)
end
class HostUnsupported < RDPError
error_key(:host_unsupported)
end

View File

@ -1,6 +1,15 @@
en:
vagrant_rdp:
errors:
guest_unsupported: |-
The guest OS detected by Vagrant ('%{name}') is reporting
that it does not supported RDP connections. If this is an
error, it is because Vagrant does not know how to connect
via RDP to this guest.
Please open an issue documenting how to connect via RDP
to this guest OS and we can fix this.
host_unsupported: |-
Vagrant doesn't support running an RDP client on your
host OS. Currently only Windows is supported for RDP

View File

@ -950,7 +950,7 @@ en:
taking too long to reboot. First, try reloading your machine with
`vagrant reload`, since a simple restart sometimes fixes things.
If that doesn't work, destroy your machine and recreate it with
a `vagrant destroy` followed by a `1vagrant up`. If that doesn't work,
a `vagrant destroy` followed by a `vagrant up`. If that doesn't work,
contact support.
ssh_connection_timeout: |-
Vagrant timed out while attempting to connect via SSH. This usually