Hello Tomer Saban, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/34513 to review the following change. Change subject: webadmin: Fixed VM moving between clusters error. ...................................................................... webadmin: Fixed VM moving between clusters error. When moving vm between clusters(Hosts from different clusters), an error message would appear saying: ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER But, after closing the message the vm would move to the other cluster as meant. This bug was fixed and now no error message appears. Change-Id: I5ebc94110b94be74b081d92da3e40a1f5bf9239e Bug-Url: https://bugzilla.redhat.com/1142629 Signed-off-by: Tomer Saban <tsa...@redhat.com> --- M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 4 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/13/34513/1 diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 277778d..c23dc88 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -1156,6 +1156,7 @@ ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk Profile wasn't found. ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. Storage Domain wasn't provided. ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain. +ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER=Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_CPU_PROFILE_IN_CLUSTER=Cannot ${action} ${type}. Cannot remove last CPU profile in Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_DISK_PROFILE_IN_STORAGE_DOMAIN=Cannot ${action} ${type}. Cannot remove last Disk profile in Storage Domain. diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index 358762e..a76e961 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -3123,6 +3123,9 @@ @DefaultStringValue("Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain.") String ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN(); + @DefaultStringValue("Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster.") + String ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER(); + @DefaultStringValue("Cannot ${action} ${type}. Cannot remove last CPU profile in Cluster.") String ACTION_TYPE_CANNOT_REMOVE_LAST_CPU_PROFILE_IN_CLUSTER(); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java index 1642124..1fffbbb 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java @@ -205,6 +205,8 @@ }), vm.getRunOnVds()); } + updateCpuProfile(vm.getVdsGroupId(), vm.getVdsGroupCompatibilityVersion(), vm.getCpuProfileId()); + getModel().getSpiceFileTransferEnabled().setEntity(vm.isSpiceFileTransferEnabled()); getModel().getSpiceCopyPasteEnabled().setEntity(vm.isSpiceCopyPasteEnabled()); @@ -218,6 +220,16 @@ updateCpuProfile(vm.getVdsGroupId(), vm.getVdsGroupCompatibilityVersion(), vm.getCpuProfileId()); } + @Override + public void dataCenterWithClusterSelectedItemChanged() { + super.dataCenterWithClusterSelectedItemChanged(); + if (getModel().getSelectedCluster() != null) { + updateCpuProfile(getModel().getSelectedCluster().getId(), + getClusterCompatibilityVersion(), + vm.getCpuProfileId()); + } + } + private int calculateHostCpus() { return getModel().getSelectedCluster().getCountThreadsAsCores() ? runningOnHost.getCpuThreads() : runningOnHost.getCpuCores(); } diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index ba416b2..b292fb3 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -1125,6 +1125,7 @@ ACTION_TYPE_FAILED_DISK_PROFILE_NOT_FOUND=Cannot ${action} ${type}. Disk Profile wasn't found. ACTION_TYPE_DISK_PROFILE_STORAGE_DOMAIN_NOT_PROVIDED=Cannot ${action} ${type}. Storage Domain wasn't provided. ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN=Cannot ${action} ${type}. Disk Profile doesn't match provided Storage Domain. +ACTION_TYPE_CPU_PROFILE_NOT_MATCH_CLUSTER=Cannot ${action} ${type}. CPU Profile doesn't match provided Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_CPU_PROFILE_IN_CLUSTER=Cannot ${action} ${type}. Cannot remove last CPU profile in Cluster. ACTION_TYPE_CANNOT_REMOVE_LAST_DISK_PROFILE_IN_STORAGE_DOMAIN=Cannot ${action} ${type}. Cannot remove last Disk profile in Storage Domain. -- To view, visit http://gerrit.ovirt.org/34513 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ebc94110b94be74b081d92da3e40a1f5bf9239e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Tomer Saban <tsa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches