From 35a3f491d56f81381ebb0867033f4afe1475fd1e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 5 Jul 2026 14:14:47 +0530 Subject: [PATCH] fixes Signed-off-by: Abhishek Kumar --- client/conf/error-messages.json.in | 6 +++--- server/src/main/java/com/cloud/vm/UserVmManagerImpl.java | 2 +- .../src/test/java/com/cloud/vm/UserVmManagerImplTest.java | 2 +- test/integration/smoke/test_deploy_vm_root_resize.py | 6 +++--- test/integration/smoke/test_vm_strict_host_tags.py | 2 +- ui/src/utils/plugins.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/conf/error-messages.json.in b/client/conf/error-messages.json.in index dc08c7d82af..c55c45cf8e2 100644 --- a/client/conf/error-messages.json.in +++ b/client/conf/error-messages.json.in @@ -493,7 +493,7 @@ "vm.scale.reconfigure.answer.failed": "Unable to scale Instance: {{error}}.", "vm.scale.root.volume.change.failed": "Failed to change disk offering of the root volume.", "vm.scale.source.host.not.found": "Unable to find source host for Instance scaling migration.", - "vm.scale.up.required": "While the VM is running, only scalling up it is supported. New service offering {{newOffering}} should have at least one value (ram, speed or cpu) greater than the current values {{currentOffering}}.", + "vm.scale.up.required": "While the VM is running, only scaling up it is supported. New service offering {{newOffering}} should have at least one value (ram, speed or cpu) greater than the current values {{currentOffering}}.", "vm.scale.vgpu.not.supported": "Dynamic scaling of vGPU type is not supported. VM has vGPU Type: {{vgpuType}}.", "vm.scale.vm.not.found": "Unable to find Instance to scale.", "vm.scale.vm.not.found.retry": "Unable to find Instance for scale migration.", @@ -609,7 +609,7 @@ "vm.updatenic.vm.not.found": "Unable to update NIC as the specified Instance is not found.", "vm.updatenic.vm.not.running.or.stopped": "Unable to update NIC {{nic}} for the Instance {{instance}} as the Instance not Running or Stopped.", "vm.updatenic.work.nic.not.found": "Unable to update NIC as the specified NIC is not found.", - "vm.updatenic.work.nic.not.found.admin": "Unable to update NIC as the specified NIC ID: {{nicId} is not found.", + "vm.updatenic.work.nic.not.found.admin": "Unable to update NIC as the specified NIC ID: {{nicId}} is not found.", "vm.updatenic.zone.basic.not.allowed": "Zone {{zone}}, has a NetworkType of Basic. Can't change default NIC on a Basic Network.", "vm.updatenicip.allocation.failed.basic": "Allocating IP to guest NIC {{nicId}} failed, please choose another IP.", "vm.updatenicip.allocation.failed.capacity": "Allocating IP to guest NIC {{nic}} failed, for insufficient address capacity.", @@ -639,7 +639,7 @@ "vm.upgrade.storage.shared.to.local": "Unable to upgrade Instance {{instance}}: target service offering uses shared storage but the volume is in a local storage pool.", "vm.upgrade.system.use.mismatch": "Unable to upgrade Instance: the system use property differs between the current and new service offering.", "vm.upgrade.vm.not.right.state": "Unable to upgrade Instance {{instance}} in state {{instanceState}}; make sure the Instance is stopped.", - "vm.upgrade.vm.sunning.scale.down.unsupported": "Scaling down is not supported while the VM is running. The new service offering attributes {\"memory\": {{newMemory}}, \"CPU speed\": {{newSpeed}}, \"vCPUs\": {{newCPU}}} must not be lower than the current values {\"memory\": {{currentMemory}}, \"CPU speed\": {{currentSpeed}}, \"vCPUs\": {{currentCPU}}}.", + "vm.upgrade.vm.running.scale.down.unsupported": "Scaling down is not supported while the VM is running. The new service offering attributes {\"memory\": {{newMemory}}, \"CPU speed\": {{newSpeed}}, \"vCPUs\": {{newCPU}}} must not be lower than the current values {\"memory\": {{currentMemory}}, \"CPU speed\": {{currentSpeed}}, \"vCPUs\": {{currentCPU}}}.", "vm.upgrade.vm.uuid.not.found": "Unable to find VM's UUID.", "vm.upgrade.vm.wrong.state": "Unable to upgrade Instance {{instance}} in state {{instanceState}}; make sure the Instance is stopped or running.", "vm.userdata.vm.not.found": "Unable to find Instance with specified ID.", diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index 66d85760933..14a7d37de08 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -2249,7 +2249,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir boolean scalingDown = newSpeed < currentSpeed || newMemory < currentMemory || newCpu < currentCpu; if (scalingDown) { - throw Exceptions.invalidParameterValueException("vm.upgrade.vm.sunning.scale.down.unsupported", Map.of( + throw Exceptions.invalidParameterValueException("vm.upgrade.vm.running.scale.down.unsupported", Map.of( "newMemory", newMemory, "newSpeed", newSpeed, "newCpu", newCpu, "currentMemory", currentMemory, "currentSpeed", currentSpeed, "currentCpu", currentCpu)); } diff --git a/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java b/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java index 43226ef879a..0bd1b5c5698 100644 --- a/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java +++ b/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java @@ -4211,7 +4211,7 @@ public class UserVmManagerImplTest { CloudRuntimeException exception = assertThrows(CloudRuntimeException.class, () -> { userVmManagerImpl.unmanageUserVM(vmId, null); }); - assertEquals("vm.unmanage.vm.not.right.state", exception.getMessage()); + assertEquals("vm.unmanage.vm.not.right.state", exception.getMessageKey()); verify(userVmDao, times(1)).releaseFromLockTable(vmId); } diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py index fc1dc0a05cb..bf64f737b51 100644 --- a/test/integration/smoke/test_deploy_vm_root_resize.py +++ b/test/integration/smoke/test_deploy_vm_root_resize.py @@ -395,10 +395,10 @@ class TestDeployVmRootSize(cloudstackTestCase): rootdisksize=newrootsize ) except Exception as ex: - success = True + if "Root disk size override (" + str(newrootsize) + " GB) is smaller than the template size" in str(ex): + success = True else: - self.debug("Virtual machine create did not fail appropriately. Error was actually : " + str(ex)) - + self.debug("Virtual machine create did not fail appropriately. Error was actually : " + str(ex)) self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately") else: self.debug("test 02 does not support hypervisor type " + self.hypervisor) diff --git a/test/integration/smoke/test_vm_strict_host_tags.py b/test/integration/smoke/test_vm_strict_host_tags.py index 09e740dcd09..2bb1135a81c 100644 --- a/test/integration/smoke/test_vm_strict_host_tags.py +++ b/test/integration/smoke/test_vm_strict_host_tags.py @@ -309,7 +309,7 @@ class TestScaleVMStrictTags(cloudstackTestCase): vm.scale(self.apiclient, serviceOfferingId=self.service_offering_h2.id) vm.start(self.apiclient) self.fail("VM should not be be able scale and start") - except Exception as e + except Exception as e: self.assertTrue("Unable to orchestrate the start of Instance" in str(e)) diff --git a/ui/src/utils/plugins.js b/ui/src/utils/plugins.js index d43b888eddf..c47c191a0f8 100644 --- a/ui/src/utils/plugins.js +++ b/ui/src/utils/plugins.js @@ -635,7 +635,7 @@ export const localeErrorUtilPlugin = { } if (params && params.constructor === Object) { for (const paramKey in params) { - localeMsg = localeMsg.replace(`{{${paramKey}}}`, params[paramKey]) + localeMsg = localeMsg.replaceAll(`{{${paramKey}}}`, params[paramKey]) } } return localeMsg