Yair Zaslavsky has posted comments on this change.
Change subject: tools: Introduction and usage of CustomPropertiesValueHelper
......................................................................
Patch Set 1: (3 inline comments)
....................................................
File
backend/manager/tools/engine-config/src/main/java/org/ovirt/engine/core/config/entity/ConfigKey.java
Line 98: * @throws InvalidParameterException
Line 99: * @throws Exception
Line 100: */
Line 101: public void safeSetValue(String value) throws
InvalidParameterException, Exception {
Line 102: System.out.println("Validation helper is " +
valueHelper.getClass().getName());
Done
Line 103: ValidationResult validationResult =
valueHelper.validate(this, value);
Line 104: if (!validationResult.isOk()) {
Line 105: StringBuilder invalidParamMsg = new StringBuilder();
Line 106: invalidParamMsg.append("Cannot set value ")
....................................................
File
backend/manager/tools/engine-config/src/main/java/org/ovirt/engine/core/config/entity/helper/CompositePasswordValueHelper.java
Line 68: while (tokenizer.hasMoreElements()) {
Line 69: String token = (String) tokenizer.nextElement();
Line 70: String[] pair = token.split(":", -1);
Line 71: String password = pair[1];
Line 72: if (!pwdValueHelper.validate(null, password).isOk()) {
Good catch. done
Line 73: returnValue = false;
Line 74: break;
Line 75: }
Line 76: }
....................................................
File
backend/manager/tools/engine-config/src/main/java/org/ovirt/engine/core/config/entity/helper/CustomPropertiesValueHelper.java
Line 16: for (int counter = 0; counter < keyValuePairs.length;
counter++) {
Line 17: String keyValuePair = keyValuePairs[counter];
Line 18: String parts[] = keyValuePair.split("=");
Line 19: if (parts.length != 2) {
Line 20: return new ValidationResult(false,"The entered value is
in imporper format. " + keyValuePair + " cannot be used for custom properties
definition.\nA string of key=value pair should be used instead, where the value
should be a correct regex expression");
Because value must be regular expression here. So I cannot just use key=value
(this is what the bug is about ;) )
Line 21: }
Line 22: try {
Line 23: Pattern.compile(parts[1]);
Line 24: } catch (PatternSyntaxException ex) {
--
To view, visit http://gerrit.ovirt.org/9457
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ieffbc359880e87a7159906579a18b2e5c63bd718
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches