openstack-router 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstack-router/region.rb +8 -0
- data/lib/openstack-router/router.rb +7 -1
- data/lib/openstack-router/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d97cd543afb99758645ca750a7224e38a108f1751709717c04e6fb25bbaafe58
|
4
|
+
data.tar.gz: 7661baffd04619174102a8c6935e89887abdbfe826c72de4e6862cefe8a39c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d076d94aad49faf567486a5289abe99af4b71da86e22b0d33fd55a891c473a50f6597c39b0e8c2132ee6c5ad57be003310e040241f1698f66faae1bd653221b1
|
7
|
+
data.tar.gz: a1bc2b9b4ef9634d5d811fabd11e04eaf0a01a5a1e9f6680b477f5d3a4ad69cbe0d68721d843221b4df192288547930707de1c2e0faa84dba9fd7711382fe396
|
@@ -61,6 +61,14 @@ module OpenStackRouter
|
|
61
61
|
do_request(service, request_name, *args, &block)
|
62
62
|
end
|
63
63
|
|
64
|
+
def my_args(request_args, region_names)
|
65
|
+
request_args.map do |arg|
|
66
|
+
next arg unless arg.class == Hash && arg.keys == region_names
|
67
|
+
|
68
|
+
arg[@name]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
64
72
|
private
|
65
73
|
|
66
74
|
def setup(service)
|
@@ -26,6 +26,11 @@ module OpenStackRouter
|
|
26
26
|
@rr_circuits = {}
|
27
27
|
end
|
28
28
|
|
29
|
+
# @return [Array<String>] the region names
|
30
|
+
def region_names
|
31
|
+
@regions.map(&:name)
|
32
|
+
end
|
33
|
+
|
29
34
|
# This method do a request on a service for each region in the router.
|
30
35
|
#
|
31
36
|
# @param [String | Symbol] service The service you want to interogate
|
@@ -67,7 +72,8 @@ module OpenStackRouter
|
|
67
72
|
def rr_request(rr_uuid, service, request, *request_args, &block)
|
68
73
|
raise ArgumentError, 'Invalid UUID given' unless @rr_circuits.key?(rr_uuid)
|
69
74
|
|
70
|
-
rr_next_region(rr_uuid)
|
75
|
+
region = rr_next_region(rr_uuid)
|
76
|
+
region.request(service, request, *region.my_args(request_args, region_names), &block)
|
71
77
|
end
|
72
78
|
|
73
79
|
private
|