Hello Eli Mesika,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/18393

to review the following change.

Change subject: core:[ExternalTasks] Cannot add sub-step under...
......................................................................

core:[ExternalTasks] Cannot add sub-step under...

[ExternalTasks] Cannot add sub-step under existing (parent) step

1) Fixing mandatory parameters step.parentStep.id => parentStep.id
2) Adding handling to the add method to inject the step parent

Change-Id: Ibc610d6f295a688ceec1b038107c07d43390b431
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=988082
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStepsResource.java
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/18393/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStepsResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStepsResource.java
index e414587..dee00ea 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStepsResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStepsResource.java
@@ -6,6 +6,7 @@
 import javax.ws.rs.core.Response;
 
 import org.apache.commons.lang.NotImplementedException;
+import org.ovirt.engine.api.model.BaseResource;
 import org.ovirt.engine.api.model.Job;
 import org.ovirt.engine.api.model.Step;
 import org.ovirt.engine.api.model.StepEnum;
@@ -41,7 +42,7 @@
         validateParameters(step, "type", "description");
         String id;
         if (step.isSetParentStep()) {
-            validateParameters(step, "step.parentStep.id");
+            validateParameters(step, "parentStep.id");
             id = step.getParentStep().getId();
         }
         else {
@@ -92,4 +93,12 @@
         model.getJob().setId(jobId.toString());
         return model;
     }
+
+    @Override
+    protected Step addLinks(Step model,
+            Class<? extends BaseResource> suggestedParent,
+            String... subCollectionMembersToExclude) {
+        Step linked = super.addLinks(model, suggestedParent, 
subCollectionMembersToExclude);
+        return injectParent(linked);
+    }
 }


-- 
To view, visit http://gerrit.ovirt.org/18393
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc610d6f295a688ceec1b038107c07d43390b431
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to