aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient
diff options
context:
space:
mode:
authorHarald Musum <musum@oath.com>2018-06-27 14:25:37 +0200
committerGitHub <noreply@github.com>2018-06-27 14:25:37 +0200
commit0800d9b7d9540fa83fb85d99e87c2d5971236fae (patch)
treedeae5ef25a7cf1815977a297e6135401ac31dfee /vespaclient
parent023089ca3180cea8fa7490d0d6f4a9083e9bc213 (diff)
Revert "loop over all config servers"
Diffstat (limited to 'vespaclient')
-rw-r--r--vespaclient/src/perl/lib/Yahoo/Vespa/VespaModel.pm30
1 files changed, 12 insertions, 18 deletions
diff --git a/vespaclient/src/perl/lib/Yahoo/Vespa/VespaModel.pm b/vespaclient/src/perl/lib/Yahoo/Vespa/VespaModel.pm
index fc5c360ff4c..b1675130ec4 100644
--- a/vespaclient/src/perl/lib/Yahoo/Vespa/VespaModel.pm
+++ b/vespaclient/src/perl/lib/Yahoo/Vespa/VespaModel.pm
@@ -166,14 +166,15 @@ sub retrieveModelConfigDefault { # ()
if (defined $CONFIG_REQUEST_TIMEOUT) {
$cmd .= " -w $CONFIG_REQUEST_TIMEOUT";
- } else {
- $cmd .= " -w 2";
}
+
if (!defined $CONFIG_SERVER_HOST) {
my $temp = `${VESPA_HOME}/bin/vespa-print-default configservers`;
- chomp($temp);
- $CONFIG_SERVER_HOST = $temp;
+ my @configServerHosts = split(' ', $temp);
+ $CONFIG_SERVER_HOST = $configServerHosts[0];
}
+ $cmd .= " -s $CONFIG_SERVER_HOST";
+
if (!defined $CONFIG_SERVER_PORT) {
my $temp = `${VESPA_HOME}/bin/vespa-print-default configserver_rpc_port`;
chomp($temp);
@@ -181,23 +182,16 @@ sub retrieveModelConfigDefault { # ()
}
$cmd .= " -p $CONFIG_SERVER_PORT";
- my $errors = "";
- foreach my $cfshost (split(' ', $CONFIG_SERVER_HOST)) {
- my $hostcmd = $cmd . " -s $cfshost";
-
- printDebug "Fetching model config '$hostcmd'.\n";
- my @data = `$cmd 2>&1`;
- if ($? != 0 || join(' ', @data) =~ /^error/) {
- $errors .= "Failed to get model config from config command line tool:\n"
- . "Command: $hostcmd\n"
+ printDebug "Fetching model config '$cmd'.\n";
+ my @data = `$cmd 2>&1`;
+ if ($? != 0 || join(' ', @data) =~ /^error/) {
+ printError "Failed to get model config from config command line tool:\n"
+ . "Command: $cmd\n"
. "Exit code: $?\n"
. "Output: " . join("\n", @data) . "\n";
- } else {
- return @data;
- }
+ exitApplication(1);
}
- printError $errors;
- exitApplication(1);
+ return @data;
}
sub fetch { # ()
my @data = &$RETRIEVE_MODEL_CONFIG();