Moti Asayag has uploaded a new change for review.

Change subject: engine: Logging a renamed entity only on success
......................................................................

engine: Logging a renamed entity only on success

If the command failed, the update command is failed and
rollbacked, hence no 'renamed-entity' event occurred.

Logging an event for 'renamed-entity' is required only
if the command has ended successfully.

Change-Id: I99d9db3654e4ec8f765fc9097827488a4f0e252a
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/45/40945/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
index ba4ea73..aefda6a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
@@ -17,7 +17,6 @@
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 
-import com.woorea.openstack.base.client.OpenStackResponseException;
 import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.aaa.SessionDataContainer;
 import org.ovirt.engine.core.bll.context.CommandContext;
@@ -102,6 +101,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.dao.DataAccessException;
+
+import com.woorea.openstack.base.client.OpenStackResponseException;
 
 public abstract class CommandBase<T extends VdcActionParametersBase> extends 
AuditLogableBase implements
         RollbackHandler, TransactionMethod<Object>, Command<T> {
@@ -1356,10 +1357,13 @@
         } finally {
             try {
                 if (getCommandShouldBeLogged()) {
-                    logRenamedEntity();
                     logCommand();
                 }
                 if (getSucceeded()) {
+                    if (getCommandShouldBeLogged()) {
+                        logRenamedEntity();
+                    }
+
                     // only after creating all tasks, we can start polling 
them (we
                     // don't want
                     // to start polling before all tasks were created, 
otherwise we


-- 
To view, visit https://gerrit.ovirt.org/40945
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to