Sahina Bose has posted comments on this change.
Change subject: engine: Enable gluster hook on cluster
......................................................................
Patch Set 19: (9 inline comments)
Thanks, Shireesh! Patchset to follow.
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/EnableGlusterHookCommand.java
Line 15: }
Line 16:
Line 17: @Override
Line 18: protected void setActionMessageParameters() {
Line 19:
addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ENABLE_GLUSTER_HOOK);
Done
Line 20: addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_HOOK);
Line 21: }
Line 22:
Line 23: @Override
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterHookStatusChangeCommand.java
Line 35: setVdsGroupId(params.getClusterId());
Line 36: }
Line 37:
Line 38: @Override
Line 39: protected BackendInternal getBackend() {
Yes. for unit test. The getBackend method in superclass is not visible to the
test as it's in a different package.
Line 40: return super.getBackend();
Line 41: }
Line 42:
Line 43: @Override
Line 52:
Line 53: if (Guid.isNullOrEmpty(getParameters().getHookId())) {
Line 54:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED);
Line 55: return false;
Line 56: }
Yes. good suggestion, will add that
Line 57:
Line 58: List <VDS> servers =
getAllUpServers(getParameters().getClusterId());
Line 59: if (servers == null || servers.size() == 0) {
Line 60:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND);
Line 100: atLeastOneSuccess = true;
Line 101: // update status in database
Line 102: // if a new server has been detected, the hook entry
needs to be added
Line 103: if (getServerHookFromList(serverHooks,
pairResult.getFirst().getId()) == null) {
Line 104: addServerHook(pairResult.getFirst().getId());
Yes, if already enabled - will add check to see if hook exists or not.
For other errors - you're right, the sync job will add the hook.
Line 105: } else {
Line 106: updateServerHookStatusInDb(entity.getId(),
pairResult.getFirst().getId(), getNewStatus());
Line 107: }
Line 108: } else {
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/EnableGlusterHookCommandTest.java
Line 51: */
Line 52: private EnableGlusterHookCommand cmd;
Line 53:
Line 54: @Rule
Line 55: public MockConfigRule mcr = new MockConfigRule();
Will check that.
Line 56:
Line 57: @Mock
Line 58: private GlusterHooksDao hooksDao;
Line 59:
Line 177: @Test
Line 178: public void canDoActionFailsOnNullCluster() {
Line 179: cmd = spy(new EnableGlusterHookCommand(new
GlusterHookParameters(null, HOOK_ID)));
Line 180: setupMocks();
Line 181: assertFalse(cmd.canDoAction());
Done
Line 182: }
Line 183:
Line 184: @Test
Line 185: public void canDoActionFailsOnNullHookId() {
....................................................
File
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
Line 590: GLUSTER_VOLUME_BRICK_REMOVED_FROM_CLI=Detected brick ${brick} removed
from Volume ${glusterVolumeName} of cluster ${VdsGroupName}, and removed it
from engine DB.
Line 591: GLUSTER_SERVER_REMOVED_FROM_CLI=Detected server ${VdsName} removed
from Cluster ${VdsGroupName}, and removed it from engine DB.
Line 592: GLUSTER_VOLUME_STARTED_FROM_CLI=Detected that Volume
${glusterVolumeName} of Cluster ${VdsGroupName} was started, and updated engine
DB with it's new status.
Line 593: GLUSTER_VOLUME_STOPPED_FROM_CLI=Detected that Volume
${glusterVolumeName} of Cluster ${VdsGroupName} was stopped, and updated engine
DB with it's new status.
Line 594: GLUSTER_HOOK_ENABLE=Gluster Hook ${GlusterHookName} enabled.
Will it do if I add it in GlusterHookStatusChangeCommand that extends from
AuditLogableBase?
....................................................
File
backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties
Line 88: job.RemoveGlusterServer=Removing Gluster Server ${VDS}
Line 89: job.RegisterDisk=Registering Disk ${DiskAlias}
Line 90: job.AddEventSubscription=Adding subscriber ${Address} to event type
${EventType}
Line 91: job.RemoveEventSubscription=Removing subscriber ${Address} from event
type ${EventType}
Line 92: job.EnableGlusterHook=Enabling Gluster Hook ${GlusterHookName}
Ok
Line 93:
Line 94: # Step types
Line 95: step.VALIDATING=Validating
Line 96: step.EXECUTING=Executing
....................................................
File
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
Line 76: EventNotificationEntity___Storage=Storage Management Events:
Line 77: EventNotificationEntity___Engine=General Management Events:
Line 78: EventNotificationEntity___GlusterVolume=Gluster Volume Events:
Line 79: EventNotificationEntity___DWH=Data Warehouse Events:
Line 80: EventNotificationEntity___GlusterHook=Gluster Hook:
Done
Line 81: AuditLogType___VDS_FAILURE=Host is non-responsive
Line 82: AuditLogType___USER_VDS_MAINTENANCE=Host was switched to Maintenance
Mode
Line 83: AuditLogType___USER_VDS_MAINTENANCE_MIGRATION_FAILED=Failed to switch
Host to Maintenance mode
Line 84: AuditLogType___VDS_MAINTENANCE=Host was switched to Maintenance Mode
--
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: 19
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches