switchman 3.0.18 → 3.0.19
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eea092610f18550e6ab0d24baa9a2746e8452341116c0b5e3a94c15b1bcb9be0
|
4
|
+
data.tar.gz: 53e0c2f7735838283311e57017de6bf020aae61f38dd394821a5bab5fdda869e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da4096ca84676fecda1bee5e99a9e7e34c1d4cc2233e4a32f391d68ccd9d93a8d641b5d4a5ecd330e5df340daca8611bad0226709ba9f9fc6653282821216e0a
|
7
|
+
data.tar.gz: d8a6f2245ac58e5ab64398245f7b14188cdb4675dea430fc2dd256b5aea73f68a81a30f5bcd3cd626634c492932bf85f3becab5dfa0a6e773abc6639615ab247
|
@@ -27,7 +27,9 @@ module Switchman
|
|
27
27
|
return configs if configs.is_a?(Array)
|
28
28
|
|
29
29
|
db_configs = configs.flat_map do |env_name, config|
|
30
|
-
|
30
|
+
# It would be nice to do the auto-fallback that we want here, but we haven't
|
31
|
+
# actually done that for years (or maybe ever) and it will be a big lift to get working
|
32
|
+
roles = config.keys.select { |k| config[k].is_a?(Hash) || (config[k].is_a?(Array) && config[k].all? { |ck| ck.is_a?(Hash) }) }
|
31
33
|
base_config = config.except(*roles)
|
32
34
|
|
33
35
|
name = "#{env_name}/primary"
|
@@ -35,7 +37,7 @@ module Switchman
|
|
35
37
|
base_db = build_db_config_from_raw_config(env_name, name, base_config)
|
36
38
|
[base_db] + roles.map do |role|
|
37
39
|
build_db_config_from_raw_config(env_name, "#{env_name}/#{role}",
|
38
|
-
base_config.merge(config[role]))
|
40
|
+
base_config.merge(config[role].is_a?(Array) ? config[role].first : config[role]))
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
data/lib/switchman/version.rb
CHANGED