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 +4 -4
- data/lib/vmonkey/version.rb +1 -1
- data/lib/vmonkey/vim/VirtualMachine.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f06b3dd64edba38e7b3f7b330edffae937941e3
|
4
|
+
data.tar.gz: 59a854225c0012e6719d3800feac1c83b7849d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdcb5eeeab2916d3b0869369c4a6301ee302d3fbe90565b1e85d4030eb7de592275e7b79f1291b1334b856eb0bc8e5f87b019f35eeccc54a23a5c7c921b20f34
|
7
|
+
data.tar.gz: 9e437485f66d560e513a208f6dbe74a78f0e34df3e5ba4f783ad2202dfc0d95e8c9ae3014e54fc57f31faad90faee22332859c5eae97dba20769aa754029fa13
|
data/lib/vmonkey/version.rb
CHANGED
@@ -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
|
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.
|
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-
|
12
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|