lorj 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core_process/cloud/process/router.rb +32 -19
- data/lib/lorj/version.rb +1 -1
- data/lib/providers/openstack/openstack.rb +7 -3
- 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: cbe0901bbfa07d90519c83339a77a0e283e205d3
|
4
|
+
data.tar.gz: 813357cfb6091233c16d726148f31745a33bd358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd5cf66499c650e34f0551c43754fb162a6b6dc63dcd0aabec518bfef20d3649b3190ba6b561ef0de70d51b52be1ea6d679d97192496a92318ebc47fa90b66d
|
7
|
+
data.tar.gz: ceb1b16973daa3daaf3093f6093c5aa28d6f4e20639e2afa1133da21d931d4e3acbfd6bd7f6bd6daba2fcce068bbb7b42bad1e6fcc6f6a24f3e049503f495936
|
@@ -32,9 +32,13 @@ class CloudProcess
|
|
32
32
|
router_name = hParams[:router_name]
|
33
33
|
end
|
34
34
|
|
35
|
+
_get_router(router_name, sub_net_obj, hParams)
|
36
|
+
end
|
37
|
+
|
38
|
+
def _get_router(router_name, sub_net_obj, hParams)
|
35
39
|
router_port = get_router_interface_attached(:port, hParams)
|
36
40
|
|
37
|
-
if router_port.length == 0
|
41
|
+
if router_port.nil? || router_port.length == 0
|
38
42
|
# Trying to get router
|
39
43
|
router = get_router(router_name)
|
40
44
|
router = create_router(router_name) if router.empty?
|
@@ -188,27 +192,36 @@ class CloudProcess
|
|
188
192
|
end
|
189
193
|
end
|
190
194
|
|
195
|
+
# Function to get the router ID in the network
|
196
|
+
# from the list of routers found.
|
197
|
+
# Query ports devices.
|
191
198
|
def get_router_interface_attached(sCloudObj, hParams)
|
192
199
|
name = hParams[:network, :name]
|
193
200
|
PrcLib.state("Searching for router port attached to the network '%s'", name)
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
201
|
+
routers = controller_query(:router, {})
|
202
|
+
routers.each do |router|
|
203
|
+
begin
|
204
|
+
router_name = router[:name]
|
205
|
+
# Searching for router port attached
|
206
|
+
#################
|
207
|
+
query = { :network_id => hParams[:network, :id],
|
208
|
+
:device_id => router[:id] }
|
209
|
+
info = {
|
210
|
+
:notfound => "Network '#{name}' not attached to router "\
|
211
|
+
"'#{router_name}'",
|
212
|
+
:checkmatch => 'Found 1 router %s. '\
|
213
|
+
"Checking exact match for network '%s'.",
|
214
|
+
:nomatch => "No router %s for network '%s' match",
|
215
|
+
:found => "Found router %s ID (#{router_name}) %s attached to "\
|
216
|
+
"network '#{name}'.",
|
217
|
+
:more => "Found several router %s. Searching for network '%s'.",
|
218
|
+
:items => [:id]
|
219
|
+
}
|
220
|
+
interfaces = query_single(sCloudObj, query, name, info)
|
221
|
+
return interfaces unless interfaces.length == 0
|
222
|
+
rescue => e
|
223
|
+
PrcLib.error("%s\n%s", e.message, e.backtrace.join("\n"))
|
224
|
+
end
|
212
225
|
end
|
213
226
|
end
|
214
227
|
|
data/lib/lorj/version.rb
CHANGED
@@ -316,14 +316,18 @@ class OpenstackController
|
|
316
316
|
oControlerObject.class,
|
317
317
|
oControlerObject.class.attributes unless
|
318
318
|
oControlerObject.class.attributes.include?(key[0])
|
319
|
-
|
320
319
|
return attributes.rh_get(key) if attributes.rh_exist?(key)
|
321
|
-
|
322
|
-
oControlerObject.send(key[0]).rh_get(key[1..-1])
|
320
|
+
_get_instance_attr(oControlerObject, key)
|
323
321
|
end
|
324
322
|
rescue => e
|
325
323
|
controller_error "==>Unable to map '%s'. %s", key, e.message
|
326
324
|
end
|
325
|
+
|
326
|
+
def _get_instance_attr(oControlerObject, key)
|
327
|
+
return nil if oControlerObject.send(key[0]).nil?
|
328
|
+
return oControlerObject.send(key[0]) if key.length == 1
|
329
|
+
oControlerObject.send(key[0]).rh_get(key[1..-1])
|
330
|
+
end
|
327
331
|
end
|
328
332
|
|
329
333
|
# Following class describe how FORJ should handle Openstack Cloud objects.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lorj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- forj team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|