mirror of https://github.com/apache/cloudstack.git
volume upload: when create template fails, rolling back transaction
This commit is contained in:
parent
ff4f31c4ea
commit
e0721fe976
|
|
@ -284,6 +284,9 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
|
|||
payload.setDescription(template.getDisplayText());
|
||||
payloads.add(payload);
|
||||
}
|
||||
if(payloads.isEmpty()) {
|
||||
throw new CloudRuntimeException("unable to find zone or an image store with enough capacity");
|
||||
}
|
||||
_resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template);
|
||||
return payloads;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue