Github user GabrielBrascher commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/928#discussion_r49688571
--- Diff: server/src/com/cloud/template/TemplateAdapterBase.java ---
@@ -293,9 +298,15 @@ public TemplateProfile
prepare(GetUploadParamsForTemplateCmd cmd) throws Resourc
zoneId = -1L;
}
+ HypervisorType hypervisorType =
HypervisorType.getType(cmd.getHypervisor());
+ if(hypervisorType == HypervisorType.None) {
+ throw new InvalidParameterValueException("Hypervisor Type: " +
cmd.getHypervisor() + " is invalid. Supported Hypervisor types are "
+ +
EnumUtils.listValues(HypervisorType.values()).replace("None, ", ""));
+ }
--- End diff --
@karuturi Can you create a method for those duplicated blocks (lines
302-305 and 274-277) and document it? Example:
checkForNoneHypervisorType(HypervisorType hypervisorType) {..}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---