vagrant-windows 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -47,6 +47,11 @@ Example:
47
47
  ```ruby
48
48
  Vagrant::Config.run do |config|
49
49
 
50
+ #The following timeout configuration is option, however if have
51
+ #any large remote_file resources in your chef recipes, you may
52
+ #experience timeouts (reported as 500 responses)
53
+ config.winrm.timeout = 1800 #Set WinRM Timeout in seconds (Default 30)
54
+
50
55
  # Configure base box parameters
51
56
  config.vm.box = "windows2008r2"
52
57
  config.vm.box_url = "./windows-2008-r2.box"
@@ -75,7 +80,8 @@ What has not been tested
75
80
 
76
81
  What does not work
77
82
  ==================
78
- - Complex networking setups
83
+ - <s>Complex networking setups</s> - Fixed in 0.0.3
84
+ - Note that I have not tested the Virtual Box 4.0 Driver, all _should_ work. Can someone please confirm?
79
85
 
80
86
  What Can I do to help?
81
87
  ======================
@@ -37,7 +37,7 @@ module Vagrant
37
37
  # If we reached this point then we successfully connected
38
38
  logger.info("WinRM is ready!")
39
39
  true
40
- rescue Timeout::Error => e
40
+ rescue Timeout::Error, HTTPClient::KeepAliveDisconnected => e
41
41
  #, Errors::SSHConnectionRefused, Net::SSH::Disconnect => e
42
42
  # The above errors represent various reasons that WinRM may not be
43
43
  # ready yet. Return false.
@@ -93,10 +93,12 @@ module Vagrant
93
93
  :pass => vm.config.winrm.password,
94
94
  :host => vm.config.winrm.host,
95
95
  :port => vm.winrm.info[:port],
96
+ :operation_timeout => vm.config.winrm.timeout,
96
97
  :basic_auth_only => true
97
98
  }.merge ({})
98
99
 
99
100
  # create a session
101
+ logger.info("Attempting WinRM session with options: #{opts}")
100
102
  begin
101
103
  endpoint = "http://#{opts[:host]}:#{opts[:port]}/wsman"
102
104
  client = ::WinRM::WinRMWebService.new(endpoint, :plaintext, opts)
@@ -167,14 +169,17 @@ module Vagrant
167
169
  end
168
170
  else
169
171
  raise Vagrant::Errors::WinRMInvalidShell, "#{shell} is not a valid type of shell"
170
- end
172
+ end
173
+
171
174
 
172
175
  exit_status = output[:exitcode]
173
176
  logger.debug exit_status.inspect
174
177
 
175
178
  # Return the final exit status
176
179
  return exit_status
177
- end
180
+ rescue ::WinRM::WinRMHTTPTransportError => e
181
+ raise Vagrant::Errors::WinRMTimeout, e.message
182
+ end
178
183
  end
179
184
  end
180
185
  end
@@ -15,7 +15,7 @@ module Vagrant
15
15
  @guest_port = 5985
16
16
  @host = "localhost"
17
17
  @max_tries = 12
18
- @timeout = 30
18
+ @timeout = 1800
19
19
  end
20
20
 
21
21
  def validate(env, errors)
@@ -13,5 +13,10 @@ module Vagrant
13
13
  status_code(552)
14
14
  error_key(:winrm_upload_error)
15
15
  end
16
+ class WinRMTimeout < VagrantError
17
+ status_code(553)
18
+ error_key(:winrm_timeout)
19
+ end
20
+
16
21
  end
17
22
  end
@@ -4,9 +4,15 @@ function Test-ReparsePoint([string]$path) {
4
4
  return [bool]($file.Attributes -band [IO.FileAttributes]::ReparsePoint)
5
5
  }
6
6
 
7
+
7
8
  $MountPoint = [System.IO.Path]::GetFullPath("<%= options[:mount_point] %>")
8
9
  $ShareName = "<%= options[:name] %>"
9
10
 
11
+ # https://github.com/BIAINC/vagrant-windows/issues/4
12
+ # Not sure why this works, but it does.
13
+
14
+ & net use $ShareName
15
+
10
16
  Write-Host "Attempting to mount $ShareName to $MountPoint"
11
17
  if( (Test-Path "$MountPoint") -and (Test-ReparsePoint "$MountPoint") )
12
18
  {
@@ -1,3 +1,3 @@
1
1
  module VagrantWindows
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-08 00:00:00.000000000 Z
12
+ date: 2012-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: winrm