Kanagaraj M has posted comments on this change.

Change subject: engine: Enable gluster hook on cluster
......................................................................


Patch Set 15: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterHookStatusChangeCommand.java
Line 109:                 if 
(!VdcBllErrors.GlusterHookAlreadyEnabled.equals(retValue.getVdsError().getCode()))
 {
Line 110:                     errors.add(retValue.getVdsError().getMessage());
Line 111:                 } else {
Line 112:                     //making sure the status in DB is updated (in 
case sync job has not yet updated these)
Line 113:                     updateServerHookStatusInDb(entity.getId(), 
pairResult.getFirst().getId(), getNewStatus());
here also atLeastOneSuccess = true;
Line 114:                 }
Line 115:             }
Line 116:         }
Line 117: 


Line 125:                 setSucceeded(false);
Line 126:             }
Line 127:         } else {
Line 128:             setSucceeded(true);
Line 129:         }
as i mentioned in my previous comment, the value of atLeastOneSuccess can alone 
determine whether the command is succeeded or not. And errors.size can be used 
only to determine whether the conflict flag to be set or not. 

So the above code can be 

 if (errors.size() > 0) {
     entity.addStatusConflict();
 }
 setSucceeded(atLeastOneSucces);

Also we should update the hook status only if the command is 
succeeded(atLeastOneSuccess==true).
Line 130:         //The intention was to enable hook. So we update the entity 
with status enabled irrespective of errors
Line 131:         entity.setStatus(getNewStatus());
Line 132:         updateHookInDb(entity);
Line 133: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc6f9c77393ebed2803ec2a1b295a09f61642c31
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <sesub...@redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Sahina Bose <sab...@redhat.com>
Gerrit-Reviewer: Selvasundaram <sesub...@redhat.com>
Gerrit-Reviewer: Shireesh Anjal <san...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to