Oved Ourfali has uploaded a new change for review. Change subject: core: Disk move job description details (#849981) ......................................................................
core: Disk move job description details (#849981) https://bugzilla.redhat.com/849981 This patch adds details to the CopyOrMoveDiskCommand job, to contain the source and target storage domains. Change-Id: Id325e9871d1bac01be1119d92853984bd6ebe1bc Signed-off-by: Oved Ourfali <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java M backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/7607/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java index 817cbf7..e82df46 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; +import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker; import org.ovirt.engine.core.bll.job.ExecutionHandler; import org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter; @@ -30,6 +31,7 @@ import org.ovirt.engine.core.common.businessentities.VmDeviceId; import org.ovirt.engine.core.common.businessentities.VmEntityType; import org.ovirt.engine.core.common.businessentities.VmTemplate; +import org.ovirt.engine.core.common.businessentities.storage_domains; import org.ovirt.engine.core.common.locks.LockingGroup; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.compat.NGuid; @@ -440,4 +442,21 @@ } } + @Override + public Map<String, String> getJobMessageProperties() { + List<storage_domains> storageDomains = getStorageDomainDAO().getAllForStorageDomain(getParameters().getSourceDomainId().getValue()); + String sourceSDName = StringUtils.EMPTY; + + if (storageDomains.size() > 0) { + sourceSDName = storageDomains.get(0).getstorage_name(); + } + if (jobProperties == null) { + jobProperties = super.getJobMessageProperties(); + jobProperties.put("sourcesd", sourceSDName); + jobProperties.put("targetsd", getStorageDomainName()); + jobProperties.put("action", getParameters().getOperation().name()); + } + return jobProperties; + } + } diff --git a/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties b/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties index 717d6be..1308076 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties @@ -36,6 +36,7 @@ job.AddVmTemplate=Creating VM Template ${VmTemplate} in Data Center ${StoragePool} job.RemoveVmTemplate=Removing VM Template ${VmTemplate} from Data Center ${StoragePool} job.MoveOrCopyTemplate=Moving VM Template ${VmTemplate} +job.MoveOrCopyDisk=${Action}ing Disk from ${SourceSD} to ${TargetSD} job.CreateAllSnapshotsFromVm=Creating VM Snapshot ${SnapshotName} for VM ${VM} job.TryBackToAllSnapshotsOfVm=Preview VM Snapshot ${SnapshotName} of VM ${VM} job.RestoreAllSnapshots=Restoring VM Snapshot ${SnapshotName} of VM ${VM} -- To view, visit http://gerrit.ovirt.org/7607 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id325e9871d1bac01be1119d92853984bd6ebe1bc Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Oved Ourfali <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
