Skip to content

Commit

Permalink
Fix test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Anshu Agarwal <anshukag@amazon.com>
  • Loading branch information
Anshu Agarwal committed Jan 4, 2023
1 parent 73fd9b8 commit ef429b2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public static ClusterGetWeightedRoutingResponse fromXContent(XContentParser pars
attrKey = parser.currentName();
} else if (token == XContentParser.Token.VALUE_STRING) {
attrValue = parser.text();
if (attrKey != null && attrKey.equals(DISCOVERED_MASTER)) {
discoveredMaster = Boolean.parseBoolean(attrValue);
} else if (attrKey != null) {
if (attrKey != null) {
weights.put(attrKey, Double.parseDouble(attrValue));
}
} else if (token == XContentParser.Token.VALUE_BOOLEAN && attrKey != null && attrKey.equals(DISCOVERED_MASTER)) {
discoveredMaster = Boolean.parseBoolean(parser.text());
} else {
throw new OpenSearchParseException("failed to parse weighted routing response");
}
Expand Down

0 comments on commit ef429b2

Please sign in to comment.