Skip to content

Commit 54e844c

Browse files
committed
Added ExtensionCustomActionTest
1 parent f3b93e6 commit 54e844c

File tree

2 files changed

+490
-1
lines changed

2 files changed

+490
-1
lines changed

api/src/main/java/org/apache/cloudstack/extension/ExtensionCustomAction.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ public static Parameter fromMap(Map<String, String> map) throws InvalidParameter
231231
typeStr, name));
232232
}
233233
ValidationFormat parsedFormat = EnumUtils.getEnumIgnoreCase(ValidationFormat.class, validationFormatStr, ValidationFormat.NONE);
234-
if (!ValidationFormat.NONE.equals(parsedFormat) && parsedFormat.getBaseType() != parsedType) {
234+
if (ValidationFormat.NONE.equals(parsedFormat)) {
235+
throw new InvalidParameterValueException(
236+
String.format("Invalid validation format: %s", validationFormatStr));
237+
} else if (parsedFormat.getBaseType() != parsedType) {
235238
throw new InvalidParameterValueException(
236239
String.format("Invalid validation format: %s specified for type: %s", parsedFormat.name(), parsedType.name()));
237240
}

0 commit comments

Comments
 (0)