Skip to content

Commit

Permalink
fix setting value to engine config properties
Browse files Browse the repository at this point in the history
Setting some of the properties returned an error [1]
This is a regression caused by https://bugzilla.redhat.com/show_bug.cgi?id=2089299

[1] https://lists.ovirt.org/archives/list/users@ovirt.org/message/OPH7BHGBGWMECQKRXY6GW3YGZR73JK2D/

Signed-off-by: dangel101 <dangel101@gmail.com>
  • Loading branch information
dangel101 authored and mwperina committed Jan 5, 2023
1 parent 03c7975 commit 4231463
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -42,7 +43,13 @@ public ConfigKey generateByPropertiesKey(String key) {
if (StringUtils.isBlank(type)) {
type = "String";
}
String[] validValues = node.findValuesAsText("validValues").toArray(new String[0]);

String[] validValues = null;
List<String> parsedValue = node.findValuesAsText("validValues");
if (!parsedValue.isEmpty()) {
// not all existing options have validValues defined
validValues = parsedValue.get(0).split(",");
}

// Description containing the list delimiter *will* be broken into an array, so rejoin it using that delimiter.
// We pad the separator because the strings in the array are trimmed automatically.
Expand Down

0 comments on commit 4231463

Please sign in to comment.