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: 21bdb8885af6932038bdf482531843f9d0157e0c51d806601937248e636ff98a
4
- data.tar.gz: 92f0ae609d94b8d7eeefa909927481964a09305a00ebcc792d8b8079625df226
3
+ metadata.gz: eea092610f18550e6ab0d24baa9a2746e8452341116c0b5e3a94c15b1bcb9be0
4
+ data.tar.gz: 53e0c2f7735838283311e57017de6bf020aae61f38dd394821a5bab5fdda869e
5
5
  SHA512:
6
- metadata.gz: 5d399c2f5de126812026515e4e5afd80380995cd8f098a561a3b17467c68caee64367ac60aa34c46c9a0f4550f9b246a459fd107d364e905db0098b665f32e9c
7
- data.tar.gz: '096f236515a0641c11805fc71f43e866301cedfced33d4662222f9a9df08e8dbdecf97dd315273c80d21252ebd75ddb447628d1b6dccff4c94d5f3f782d5d7af'
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
- roles = config.keys.select { |k| config[k].is_a?(Hash) }
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
 
@@ -71,7 +71,7 @@ module Switchman
71
71
  if role == 'primary'
72
72
  @database_servers[name] = DatabaseServer.new(config.env_name, config.configuration_hash)
73
73
  else
74
- @database_servers[name].roles << role
74
+ @database_servers[name].roles << role.to_sym
75
75
  end
76
76
  end
77
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = '3.0.18'
4
+ VERSION = '3.0.19'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.18
4
+ version: 3.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer