diff --git a/lib/synapse/haproxy.rb b/lib/synapse/haproxy.rb index 8fb9f970..496f12ee 100644 --- a/lib/synapse/haproxy.rb +++ b/lib/synapse/haproxy.rb @@ -538,7 +538,6 @@ def initialize(opts) @opts['do_writes'] = true unless @opts.key?('do_writes') @opts['do_socket'] = true unless @opts.key?('do_socket') @opts['do_reloads'] = true unless @opts.key?('do_reloads') - @opts['ignore_weights'] = true unless @opts.key?('ignore_weights') # how to restart haproxy @restart_interval = @opts.fetch('restart_interval', 2).to_i @@ -749,10 +748,10 @@ def generate_backend_stanza(watcher, config) end end b = "#{b} #{watcher.haproxy['server_options']}" if watcher.haproxy['server_options'] - if !@opts['ignore_weights'] && backend.has_key?('weight') + if backend.has_key?('weight') # Check if server_options already contains weight, is so log a warning if watcher.haproxy['server_options'].include? 'weight' - log.info "synapse: weight is defined by server_options and by nerve" + log.warn "synapse: weight is defined by server_options and by nerve" end weight = backend['weight'].to_i b = "#{b} weight #{weight}" diff --git a/spec/lib/synapse/service_watcher_base_spec.rb b/spec/lib/synapse/service_watcher_base_spec.rb index 9b7bcbcf..42621575 100644 --- a/spec/lib/synapse/service_watcher_base_spec.rb +++ b/spec/lib/synapse/service_watcher_base_spec.rb @@ -136,7 +136,7 @@ def remove_arg(name) end end - context 'with ignore_weights set to false' do + context 'with weights defined' do let(:backends_with_weight) { [ { 'name' => 'server1', 'host' => 'server1', 'port' => 1111, 'weight' => 11 }, { 'name' => 'server2', 'host' => 'server2', 'port' => 2222, 'weight' => 22 }, diff --git a/spec/support/minimum.conf.yaml b/spec/support/minimum.conf.yaml index 87775393..5df62fb9 100644 --- a/spec/support/minimum.conf.yaml +++ b/spec/support/minimum.conf.yaml @@ -22,7 +22,6 @@ haproxy: config_file_path: "/etc/haproxy/haproxy.cfg" do_writes: false do_reloads: false - ignore_weights: false global: - global_test_option