Github user DaanHoogland commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1403#discussion_r62881271
--- Diff:
engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
---
@@ -554,6 +574,51 @@ protected Void
managedCopyBaseImageCallback(AsyncCallbackDispatcher<VolumeServic
return null;
}
+ protected Void
createManagedTemplateImageCallback(AsyncCallbackDispatcher<VolumeServiceImpl,
CreateCmdResult> callback, CreateVolumeContext<CreateCmdResult> context) {
+ CreateCmdResult result = callback.getResult();
+ VolumeApiResult res = new VolumeApiResult(null);
+
+ res.setResult(result.getResult());
+
+ AsyncCallFuture<VolumeApiResult> future = context.getFuture();
+ DataObject templateOnPrimaryStoreObj = context.getVolume();
+
+ if (result.isSuccess()) {
+
((TemplateObject)templateOnPrimaryStoreObj).setInstallPath(result.getPath());
+
templateOnPrimaryStoreObj.processEvent(Event.OperationSuccessed,
result.getAnswer());
+ }
+ else {
+ templateOnPrimaryStoreObj.processEvent(Event.OperationFailed);
+ }
+
+ future.complete(res);
+
+ return null;
+ }
+
+ protected Void
copyManagedTemplateCallback(AsyncCallbackDispatcher<VolumeServiceImpl,
CopyCommandResult> callback, CreateBaseImageContext<VolumeApiResult> context) {
--- End diff --
same here, why Void and returning a null? returning null is a bad smell to
me.
---
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.
---