commands/rdp: config

This commit is contained in:
Mitchell Hashimoto 2014-04-12 16:37:44 -07:00
parent 3d0a2959cd
commit 5b5f10e175
3 changed files with 30 additions and 2 deletions

View File

@ -48,11 +48,11 @@ module VagrantPlugins
end
host = ssh_info[:host]
port = 3389
port = machine.config.rdp.port
if host == "127.0.0.1"
# We need to find a forwarded port...
search_port = 3389
search_port = machine.config.rdp.search_port
ports = nil
if machine.provider.capability?(:forwarded_ports)
ports = machine.provider.capability(:forwarded_ports)

View File

@ -0,0 +1,23 @@
module VagrantPlugins
module CommandRDP
class Config < Vagrant.plugin("2", :config)
attr_accessor :port
attr_accessor :search_port
def initialize
@port = UNSET_VALUE
@search_port = UNSET_VALUE
end
def finalize!
@port = 3389 if @port == UNSET_VALUE
@search_port = 3389 if @search_port == UNSET_VALUE
end
def validate(machine)
errors = _detected_errors
{ "RDP" => errors }
end
end
end
end

View File

@ -17,6 +17,11 @@ module VagrantPlugins
Command
end
config("rdp") do
require_relative "config"
Config
end
protected
def self.init!