vmonkey 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e70eff6ca91cea320ab02850bb495ea5379e43bf
4
- data.tar.gz: 5be15a57203fd28ce38cb87808004a7da161c96b
3
+ metadata.gz: 3f06b3dd64edba38e7b3f7b330edffae937941e3
4
+ data.tar.gz: 59a854225c0012e6719d3800feac1c83b7849d5b
5
5
  SHA512:
6
- metadata.gz: 2bf1a23be2e66ff2b6a76b135c58d3c2599989a463cec4fe95ce0752c2139c7cde73efeb10cf2e8cd465953cee580ab70ef33422a8e56bb00fb88d8c5e3c107a
7
- data.tar.gz: 1335dbd621d0b1e65c5d42a039889e4ec12f26fdfc3fe23f2c06aea1a16044a31ecc3ec3923a3c2420df89ff8248cbd6a073665a88c4c919bc716c715524afa9
6
+ metadata.gz: cdcb5eeeab2916d3b0869369c4a6301ee302d3fbe90565b1e85d4030eb7de592275e7b79f1291b1334b856eb0bc8e5f87b019f35eeccc54a23a5c7c921b20f34
7
+ data.tar.gz: 9e437485f66d560e513a208f6dbe74a78f0e34df3e5ba4f783ad2202dfc0d95e8c9ae3014e54fc57f31faad90faee22332859c5eae97dba20769aa754029fa13
@@ -1,3 +1,3 @@
1
1
  module Vmonkey
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -86,6 +86,7 @@ class RbVmomi::VIM::VirtualMachine
86
86
  def port_ready?(port, timeout = 5)
87
87
  ip = guest_ip or return false
88
88
 
89
+
89
90
  ## modified from http://spin.atomicobject.com/2013/09/30/socket-connection-timeout-ruby/
90
91
  addr = Socket.getaddrinfo(ip, nil)
91
92
  sockaddr = Socket.pack_sockaddr_in(port, addr[0][3])
@@ -108,10 +109,8 @@ class RbVmomi::VIM::VirtualMachine
108
109
  socket.connect_nonblock(sockaddr)
109
110
  rescue Errno::EISCONN
110
111
  # Good news everybody, the socket is connected!
111
- socket.close
112
112
  return true
113
113
  rescue Errno::ETIMEDOUT, Errno::EPERM, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ENETUNREACH
114
- socket.close
115
114
  return false
116
115
  rescue
117
116
  # An unexpected exception was raised - the connection is no good.
@@ -120,12 +119,13 @@ class RbVmomi::VIM::VirtualMachine
120
119
  else
121
120
  # IO.select returns nil when the socket is not ready before timeout
122
121
  # seconds have elapsed
123
- socket.close
124
122
  return false
125
123
  end
124
+ ensure
125
+ socket.close
126
126
  end
127
127
 
128
- return false
128
+ return true
129
129
  end
130
130
  end
131
131
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmonkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dupras
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-25 00:00:00.000000000 Z
12
+ date: 2014-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri