Ian Main
2009-Jul-07 19:25 UTC
[Ovirt-devel] [PATCH] Let ovirt-test use DNS SRV to get qpidd server.
This patch teaches ovirt-test to use the usual DNS SRV records to connect to qpidd so we don't have to enter the server etc. on the command line. Signed-off-by: Ian Main <imain at redhat.com> --- src/ovirt-agent/ovirt-test.rb | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ovirt-agent/ovirt-test.rb b/src/ovirt-agent/ovirt-test.rb index 71f9a9f..412a8ee 100755 --- a/src/ovirt-agent/ovirt-test.rb +++ b/src/ovirt-agent/ovirt-test.rb @@ -6,14 +6,10 @@ require 'rubygems' require 'qpid' require 'dutils' -if ARGV.size == 1 - srv = ARGV[0] -else - srv = "amqp://localhost" -end - +server, port = get_srv('qpidd', 'tcp') get_credentials('qpidd') +srv = "amqp://#{server}:#{port}" puts "Connecting to #{srv}.." s = Qpid::Qmf::Session.new() -- 1.6.0.6
Scott Seago
2009-Jul-08 20:41 UTC
[Ovirt-devel] [PATCH] Let ovirt-test use DNS SRV to get qpidd server.
Ian Main wrote:> This patch teaches ovirt-test to use the usual DNS SRV records to > connect to qpidd so we don't have to enter the server etc. on the > command line. > > Signed-off-by: Ian Main <imain at redhat.com> > --- > src/ovirt-agent/ovirt-test.rb | 8 ++------ > 1 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/src/ovirt-agent/ovirt-test.rb b/src/ovirt-agent/ovirt-test.rb > index 71f9a9f..412a8ee 100755 > --- a/src/ovirt-agent/ovirt-test.rb > +++ b/src/ovirt-agent/ovirt-test.rb > @@ -6,14 +6,10 @@ require 'rubygems' > require 'qpid' > require 'dutils' > > -if ARGV.size == 1 > - srv = ARGV[0] > -else > - srv = "amqp://localhost" > -end > - > +server, port = get_srv('qpidd', 'tcp') > > get_credentials('qpidd') > +srv = "amqp://#{server}:#{port}" > > puts "Connecting to #{srv}.." > s = Qpid::Qmf::Session.new() >ACK. Works for me. Scott