Ravi Nori has uploaded a new change for review. Change subject: engine : User is UNKNOWN in async task completion events ......................................................................
engine : User is UNKNOWN in async task completion events In async tasks after the user has been logged out the audit log messages show user as UNKNOWN. This patch uses the owner id of the job to get the user who initiated the task. Change-Id: Ic0904f9f6d9432ecac1cebee3790eae902a1329a Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=869660 Signed-off-by: Ravi Nori <rn...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/96/10896/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 bbcb713..cd64407 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 @@ -50,6 +50,7 @@ import org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot; import org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.EntityStatusSnapshot; import org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.SnapshotType; +import org.ovirt.engine.core.common.businessentities.DbUser; import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum; import org.ovirt.engine.core.common.businessentities.storage_pool; import org.ovirt.engine.core.common.businessentities.tags; @@ -1613,6 +1614,12 @@ if (executionContext != null) { setExecutionContext(executionContext); if (executionContext.getJob() != null) { + if (executionContext.getJob().getOwnerId() != null) { + DbUser user = DbFacade.getInstance().getDbUserDao().get(executionContext.getJob().getOwnerId().getValue()); + if (user != null) { + setUserName(user.getusername()); + } + } setJobId(executionContext.getJob().getId()); } else if (executionContext.getStep() != null) { setJobId(executionContext.getStep().getJobId()); -- To view, visit http://gerrit.ovirt.org/10896 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0904f9f6d9432ecac1cebee3790eae902a1329a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <rn...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches