Shireesh Anjal has uploaded a new change for review.

Change subject: gluster: Log details of option being set
......................................................................

gluster: Log details of option being set

Midified the audit log message for setting a volume option
to include the key and value of the option, so that user
knows exactly what option was set to what value.

Change-Id: I7c5b4712128056a4ba5f1d87cf8fd9114f95116b
Signed-off-by: Shireesh Anjal <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/10908/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
index ed07d71..1d4f997 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
@@ -1,10 +1,13 @@
 package org.ovirt.engine.core.bll.gluster;
 
+import java.util.Map;
+
 import org.ovirt.engine.core.bll.LockIdNameAttribute;
 import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity;
+import org.ovirt.engine.core.common.constants.gluster.GlusterConstants;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
 import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters;
@@ -23,6 +26,13 @@
     }
 
     @Override
+    public Map<String, String> getCustomValues() {
+        AddCustomValue(GlusterConstants.OPTION_KEY, 
getParameters().getVolumeOption().getKey());
+        AddCustomValue(GlusterConstants.OPTION_VALUE, 
getParameters().getVolumeOption().getValue());
+        return super.getCustomValues();
+    }
+
+    @Override
     protected void setActionMessageParameters() {
         addCanDoActionMessage(VdcBllMessages.VAR__ACTION__SET);
         addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME_OPTION);
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index 59ab260..ce9ce6f 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -539,8 +539,8 @@
 # Gluster Messages
 GLUSTER_VOLUME_CREATE=Gluster Volume ${glusterVolumeName} created.
 GLUSTER_VOLUME_CREATE_FAILED=Creation of Gluster Volume ${glusterVolumeName} 
failed.
-GLUSTER_VOLUME_OPTION_SET=Volume Option set on  ${glusterVolumeName}.
-GLUSTER_VOLUME_OPTION_SET_FAILED=Volume Option could not be set on 
${glusterVolumeName}.
+GLUSTER_VOLUME_OPTION_SET=Volume Option ${Key}=${Value} set on 
${glusterVolumeName}.
+GLUSTER_VOLUME_OPTION_SET_FAILED=Volume Option ${Key}=${Value} could not be 
set on ${glusterVolumeName}.
 GLUSTER_VOLUME_START=Gluster Volume ${glusterVolumeName} started.
 GLUSTER_VOLUME_START_FAILED=Could not start Gluster Volume 
${glusterVolumeName}.
 GLUSTER_VOLUME_STOP=Gluster Volume ${glusterVolumeName} stopped.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c5b4712128056a4ba5f1d87cf8fd9114f95116b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shireesh Anjal <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to