Shubhendu Tripathi has uploaded a new change for review.

Change subject: gluster: Host detach case sync message corrected
......................................................................

gluster: Host detach case sync message corrected

Corrected the event log message displayed in the case of detach of a
host from CLI. Now it shows the hots name as well in the message
corrected instead of showing as UNKNOWN.

Change-Id: I2858ded9cfac2dc6df03928b90469876878aa94d
Bug-Url: https://bugzilla.redhat.com/956996
Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/constants/gluster/GlusterConstants.java
2 files changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/15177/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
index 50b91ac..7b34a53 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
@@ -134,11 +134,18 @@
     }
 
     private void removeDetachedServers(List<VDS> existingServers, 
List<GlusterServerInfo> fetchedServers) {
-        for (VDS server : existingServers) {
+        for (final VDS server : existingServers) {
             if (isRemovableStatus(server.getStatus()) && 
serverDetached(server, fetchedServers)) {
                 log.debugFormat("Server {0} has been removed directly using 
the gluster CLI. Removing it from engine as well.",
                         server.getName());
                 logUtil.logServerMessage(server, 
AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI);
+                logUtil.logAuditMessage(server.getVdsGroupId(), null, server,
+                        AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI,
+                        new HashMap<String, String>() {
+                            {
+                                put(GlusterConstants.VDS_GROUP_NAME, 
server.getVdsGroupName());
+                            }
+                        });
 
                 try {
                     removeServerFromDb(server);
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/constants/gluster/GlusterConstants.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/constants/gluster/GlusterConstants.java
index 3dbe6411..48141be 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/constants/gluster/GlusterConstants.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/constants/gluster/GlusterConstants.java
@@ -26,6 +26,7 @@
     public static final String NEW_STATUS = "newstatus";
     public static final String SERVICE_TYPE = "servicetype";
     public static final String SERVICE_NAME = "servicename";
+    public static final String VDS_GROUP_NAME = "VdsGroupName";
 
     public static final String HOOK_NAME = "glusterhookname";
     public static final String FAILURE_MESSAGE = "failuremessage";


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2858ded9cfac2dc6df03928b90469876878aa94d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to