From 2caaf82ae0ac9975a1195d7ac95c2d088ff5a83b Mon Sep 17 00:00:00 2001 From: Max Lincoln Date: Wed, 23 Jul 2014 15:04:33 -0400 Subject: [PATCH] Change default transport back to :plaintext, for backwards compatibility --- plugins/communicators/winrm/config.rb | 6 +++--- .../unit/plugins/communicators/winrm/shell_test.rb | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/communicators/winrm/config.rb b/plugins/communicators/winrm/config.rb index 0e7db6f63..ea381ae0e 100644 --- a/plugins/communicators/winrm/config.rb +++ b/plugins/communicators/winrm/config.rb @@ -23,9 +23,9 @@ module VagrantPlugins end def finalize! - @username = "vagrant" if @username == UNSET_VALUE - @password = "vagrant" if @password == UNSET_VALUE - @transport = :ssl if @transport == UNSET_VALUE + @username = "vagrant" if @username == UNSET_VALUE + @password = "vagrant" if @password == UNSET_VALUE + @transport = :plaintext if @transport == UNSET_VALUE @host = nil if @host == UNSET_VALUE is_ssl = @transport == :ssl @port = (is_ssl ? 5986 : 5985) if @port == UNSET_VALUE diff --git a/test/unit/plugins/communicators/winrm/shell_test.rb b/test/unit/plugins/communicators/winrm/shell_test.rb index 18d2dd021..05e8351b4 100644 --- a/test/unit/plugins/communicators/winrm/shell_test.rb +++ b/test/unit/plugins/communicators/winrm/shell_test.rb @@ -52,18 +52,18 @@ describe VagrantPlugins::CommunicatorWinRM::WinRMShell do describe ".endpoint" do context 'when transport is :ssl' do + let(:config) { + VagrantPlugins::CommunicatorWinRM::Config.new.tap do |c| + c.transport = :ssl + c.finalize! + end + } it "should create winrm endpoint address using https" do expect(subject.send(:endpoint)).to eq("https://localhost:5986/wsman") end end context "when transport is :plaintext" do - let(:config) { - VagrantPlugins::CommunicatorWinRM::Config.new.tap do |c| - c.transport = :plaintext - c.finalize! - end - } it "should create winrm endpoint address using http" do expect(subject.send(:endpoint)).to eq("http://localhost:5985/wsman") end @@ -73,7 +73,7 @@ describe VagrantPlugins::CommunicatorWinRM::WinRMShell do describe ".endpoint_options" do it "should create endpoint options" do expect(subject.send(:endpoint_options)).to eq( - { user: "username", pass: "password", host: "localhost", port: 5986, + { user: "username", pass: "password", host: "localhost", port: 5985, basic_auth_only: true, no_ssl_peer_verification: false }) end end