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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c625802ba2090efd3f6e782bc28577d48cccdb75d5562d5730e113e00595ea54
4
- data.tar.gz: 6799ba121d667839b22bd30153a22752166e7fa7178e02b1ee1ba7ad9b586bd2
3
+ metadata.gz: d97cd543afb99758645ca750a7224e38a108f1751709717c04e6fb25bbaafe58
4
+ data.tar.gz: 7661baffd04619174102a8c6935e89887abdbfe826c72de4e6862cefe8a39c81
5
5
  SHA512:
6
- metadata.gz: 3a579014ffac9edc697d7694fbe7bc85a7f47fd72b6841e1708001800d198b11ff8100d4e91076f043530afb82ed99a3f91f76ecb6a558eb1c28bf01e25817e3
7
- data.tar.gz: 78ae040b3471a1cc43d1cf77370360c728a7f32004e19452097a4d45c03cdbafca29b1ddd205c03ab89375d4a1999f589045bdfc1f684bd633b90758df201ff8
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).request(service, request, *request_args, &block)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module OpenStackRouter
4
4
  # The version number of this library
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstack-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Laurès