From 536f1767bb70ee67bb5db857876619edc0dffb0e Mon Sep 17 00:00:00 2001 From: Chris Alfonso Date: Tue, 25 Nov 2014 08:38:22 -0700 Subject: [PATCH] BZ1167625 - Fail to start openshift-routing-daemon service when no port * Fail to start openshift-routing-daemon service when no port is specified for ACTIVEMQ_HOST. --- routing-daemon/lib/openshift/routing/daemon.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/routing-daemon/lib/openshift/routing/daemon.rb b/routing-daemon/lib/openshift/routing/daemon.rb index 3122e2d374e..a6e9426bf83 100644 --- a/routing-daemon/lib/openshift/routing/daemon.rb +++ b/routing-daemon/lib/openshift/routing/daemon.rb @@ -40,14 +40,15 @@ def read_config cfgfile @password = @cfg['ACTIVEMQ_PASSWORD'] || 'routinginfopasswd' @port = (@cfg['ACTIVEMQ_PORT'] || 61613).to_i @hosts = (@cfg['ACTIVEMQ_HOST'] || 'activemq.example.com').split(',').map do |hp| - hp.split(":").instance_eval do |h,p,ssl| + chunks = hp.split(":") + h = chunks[0] + p = chunks.size > 1 ? chunks[1] : @port { :host => h, # Originally, ACTIVEMQ_HOST allowed specifying only one host, with # the port specified separately in ACTIVEMQ_PORT. - :port => p || @cfg['ACTIVEMQ_PORT'] || '61613', - } - end + :port => p + } end @plugin_prefix = "plugin.activemq.pool." pools = @cfg["#{@plugin_prefix}size"]