openstack 3.3.16 → 3.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/openstack.rb +1 -0
- data/lib/openstack/connection.rb +14 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3118591896f4d8985f96e629ee024553efc6ccec
|
4
|
+
data.tar.gz: 234766f3da131d005ddb7e156ab5fe731ec6a565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b42b5d8d46fa3a6a68ba01bdccd891a0a7a07b9f333b0b1f8adeb5440e68529399b9751a52210324eed90f516dd09c6db52dd998f398ee9842f0899f6bb3df
|
7
|
+
data.tar.gz: eec481dffdcbf4fe0e35155e098f0aedf0943bced420ccff75ac9886ad8937f995a5a0fe1603c659f8adbf8f548997f0b207eabc12e446e5e98ebf86fe2a6f82
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.17
|
data/lib/openstack.rb
CHANGED
data/lib/openstack/connection.rb
CHANGED
@@ -151,6 +151,7 @@ class Connection
|
|
151
151
|
@quantum_version = 'v2.0' if @service_type == 'network'
|
152
152
|
@quantum_version = 'v2' if @service_type == 'metering'
|
153
153
|
@endpoint_type = options[:endpoint_type] || "publicURL"
|
154
|
+
@semaphore = Mutex.new
|
154
155
|
end
|
155
156
|
|
156
157
|
#specialised from of csreq for PUT object... uses body_stream if possible
|
@@ -172,7 +173,10 @@ class Connection
|
|
172
173
|
request.body = data
|
173
174
|
end
|
174
175
|
start_http(server,path,port,scheme,hdrhash)
|
175
|
-
response =
|
176
|
+
response = nil
|
177
|
+
@semaphore.synchronize do
|
178
|
+
response = @http[server].request(request)
|
179
|
+
end
|
176
180
|
if @is_debug
|
177
181
|
puts "REQUEST: PUT => #{path}"
|
178
182
|
puts data if data
|
@@ -210,14 +214,17 @@ class Connection
|
|
210
214
|
start_http(server,path,port,scheme,hdrhash)
|
211
215
|
request = Net::HTTP.const_get(method.to_s.capitalize).new(path,hdrhash)
|
212
216
|
request.body = data
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
+
response = nil
|
218
|
+
@semaphore.synchronize do
|
219
|
+
if block_given?
|
220
|
+
response = @http[server].request(request) do |res|
|
221
|
+
res.read_body do |b|
|
222
|
+
yield b
|
223
|
+
end
|
217
224
|
end
|
225
|
+
else
|
226
|
+
response = @http[server].request(request)
|
218
227
|
end
|
219
|
-
else
|
220
|
-
response = @http[server].request(request)
|
221
228
|
end
|
222
229
|
log_request(request_id, "RESPONSE: Code => #{response.code} Time => #{(Time.now.to_f * 1000) - started_timestamp}ms")
|
223
230
|
if @is_debug
|