ovirt-engine icon indicating copy to clipboard operation
ovirt-engine copied to clipboard

core:change conflict message to be more informative

Open ArtiomDivak opened this issue 2 years ago • 3 comments

when trying to remove VM while its disks are being transferred(uploaded or downloaded) you get this error message: 'Cannot remove VM: VM is locked. Please try again in a few minutes.' Now it will show more informative message: 'Cannot remove VM. Disk vm_Disk is being downloaded or uploaded.' Also when the multipal snapshots disks are downloaded and we are trying to remove the vm the conflict message will show the same conflict message with the same disk name instead of different names

Bug-Url: https://bugzilla.redhat.com/2066078 Signed-off-by: Artiom Divak [email protected]

ArtiomDivak avatar Aug 10 '22 05:08 ArtiomDivak

  1. You are referencing the bug https://bugzilla.redhat.com/2066078 that is closed already. Do you have some other bug that describes the issue?
  2. I don't see in the patch any changes in the message itself. Maybe there are some other files that you forgot to include into the commit?

smelamud avatar Aug 10 '22 17:08 smelamud

Hi @smelamud,

  1. The issue was resolved partly that's why I am reopening that bug to resolve it fully
  2. I will change the comment to be more informative about what I am resolving now

ArtiomDivak avatar Aug 15 '22 08:08 ArtiomDivak

I agree with Shmuel here. Instead of modifying the core class that is used by every command, try to modify just your command. I can see you create the error message like this:

    private String getDiskIsBeingTransferredLockMessage() {
        return new LockMessage(EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_TRANSFERRED)
                .withOptional("DiskName", getDiskImage().getDiskAlias() != null ? getDiskImage().getDiskAlias() : "")
                .toString();
    }

If I understand you correctly, you want to pass more disk image aliases to the error message. Why not to concat those names in the command and pass the string as DiskName? You might need to change the message to Disk(s) ${DiskName} is/are being transferred.

ljelinkova avatar Aug 18 '22 08:08 ljelinkova

Closing the PR as there was no activity for a long time and changing the core UI class would be too risky.

ljelinkova avatar Nov 01 '22 12:11 ljelinkova