rest_connection 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rest_connection/rightscale/server.rb +21 -11
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -118,19 +118,29 @@ class Server
|
|
118
118
|
end
|
119
119
|
|
120
120
|
# waits until the server is operational and dns_name is available
|
121
|
-
def wait_for_operational_with_dns(
|
122
|
-
|
123
|
-
wait_for_state("operational",
|
124
|
-
|
125
|
-
|
121
|
+
def wait_for_operational_with_dns(operational_timeout_in_seconds = 1200, dns_timeout_in_seconds = operational_timeout_in_seconds / 2)
|
122
|
+
# First, wait for the server to go operational
|
123
|
+
wait_for_state("operational", operational_timeout_in_seconds)
|
124
|
+
|
125
|
+
# Log that we are switching to waiting for dns
|
126
|
+
connection.logger "#{self.nickname} is operational, now checking for dns name/ip address..."
|
127
|
+
|
128
|
+
# Now poll for valid dns
|
129
|
+
dns_timeout = dns_timeout_in_seconds
|
130
|
+
dns_step = 15
|
131
|
+
while(dns_timeout > 0)
|
126
132
|
self.settings
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
133
|
+
if self.reachable_ip
|
134
|
+
# Got a dns name/ip address so log that and return (note that "reachable_ip" returns a dns name on AWS and an ip address on generic clouds)
|
135
|
+
connection.logger "Got dns name/ip address: #{self.reachable_ip}."
|
136
|
+
return
|
137
|
+
end
|
138
|
+
connection.logger "Waiting #{dns_step} seconds before checking for dns name/ip address on #{self.nickname}..."
|
139
|
+
sleep dns_step
|
140
|
+
dns_timeout -= dns_step
|
131
141
|
end
|
132
|
-
|
133
|
-
raise "FATAL,
|
142
|
+
|
143
|
+
raise "FATAL, server #{self.nickname}, #{self.audit_link} timed out waiting for dns name/ip address, waited for #{dns_timeout_in_seconds}."
|
134
144
|
end
|
135
145
|
|
136
146
|
def audit_link
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_connection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Deininger
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-11-
|
19
|
+
date: 2012-11-20 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: activesupport
|