Daniel Erez has uploaded a new change for review.

Change subject: core: LiveMigrateDiskCommand - audit log on failure
......................................................................

core: LiveMigrateDiskCommand - audit log on failure

Since LiveMigrateDiskCommand is an internal command,
canDoAction error messages aren't displayed to the user.
Hence, invoke an AuditLog message on canDoAction failure.

Change-Id: Ie326395fe9d610f578829c9c5b8847097dfc7b27
Bug-Url: https://bugzilla.redhat.com/968203
Signed-off-by: Daniel Erez <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/17186/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java
index a83e96f..a2a8e26 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java
@@ -18,6 +18,7 @@
 import org.ovirt.engine.core.common.businessentities.ImageStatus;
 import org.ovirt.engine.core.common.businessentities.VM;
 import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector;
 
 @NonTransactiveCommandAttribute
 public class LiveMigrateDiskCommand<T extends LiveMigrateDiskParameters> 
extends MoveOrCopyDiskCommand<T> implements 
TaskHandlerCommand<LiveMigrateDiskParameters> {
@@ -138,6 +139,17 @@
     }
 
     @Override
+    protected boolean canDoAction() {
+        boolean canDoAction = super.canDoAction();
+
+        if (!canDoAction) {
+            AuditLogDirector.log(this, 
AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE);
+        }
+
+        return canDoAction;
+    }
+
+    @Override
     public AuditLogType getAuditLogTypeValue() {
         switch (getActionState()) {
         case EXECUTE:


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

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

Reply via email to