aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-11-22 20:12:15 +0100
committerHarald Musum <musum@verizonmedia.com>2020-11-22 20:12:15 +0100
commit572248de7aafbb4d3388024da0ee4252858819f0 (patch)
treee8270bd01fcc808a9789cc10fe9d531061e06d4d /config
parent9df6cbf5612830a1a691a9a5ce56fbd72eb44068 (diff)
Output config when configs are not equal
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java b/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java
index cea40da52b9..f79abbddc56 100644
--- a/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java
+++ b/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config;
import ai.vespa.util.http.VespaHttpClientBuilder;
@@ -72,23 +72,22 @@ public class ConfigVerification {
for (Map.Entry<String, Stack<String>> entry : mappings.entrySet()) {
recurseUrls.add(entry.getValue().pop());
}
- int ret = compareOutputs(performRequests(recurseUrls, httpClient));
- if (ret != 0) {
- return ret;
- }
+ if ( ! equalOutputs(performRequests(recurseUrls, httpClient)))
+ return -1;
}
return 0;
}
- private static int compareOutputs(Map<String, String> outputs) {
+ private static boolean equalOutputs(Map<String, String> outputs) {
Map.Entry<String, String> firstEntry = outputs.entrySet().iterator().next();
for (Map.Entry<String, String> entry : outputs.entrySet()) {
if (!entry.getValue().equals(firstEntry.getValue())) {
- System.out.println("output from '" + entry.getKey() + "' did not equal output from '" + firstEntry.getKey() + "'");
- return -1;
+ System.out.println("output from '" + entry.getKey() + "': '" + entry.getValue() +
+ "' did not equal output from '" + firstEntry.getKey() + "': '" + firstEntry.getValue() + "'");
+ return false;
}
}
- return 0;
+ return true;
}
private static String performRequest(String url, CloseableHttpClient httpClient) throws IOException {