Skip to content

Commit 25603ee

Browse files
Apply suggestions from code review
Co-authored-by: Davi Torres <90287660+daviftorres@users.noreply.github.com>
1 parent c7b4698 commit 25603ee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ private boolean upgradeRunningVirtualMachine(Long vmId, Long newServiceOfferingI
20552055

20562056
_accountMgr.checkAccess(caller, null, true, vmInstance);
20572057

2058-
//Check if it's a scale "up"
2058+
// Check if it's a scale "up"
20592059
ServiceOfferingVO newServiceOffering = serviceOfferingDao.findById(newServiceOfferingId);
20602060
if (newServiceOffering.isDynamic()) {
20612061
newServiceOffering.setDynamicFlag(true);
@@ -3847,7 +3847,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service
38473847
if (networkIdList == null || networkIdList.isEmpty()) {
38483848
Network networkWithSecurityGroup = _networkModel.getNetworkWithSGWithFreeIPs(owner, zone.getId());
38493849
if (networkWithSecurityGroup == null) {
3850-
throw new InvalidParameterValueException("No network with security enabled is found in zone ID=" + zone.getUuid());
3850+
throw new InvalidParameterValueException("No network with security enabled is found in zone ID = " + zone.getUuid());
38513851
}
38523852

38533853
networkList.add(_networkDao.findById(networkWithSecurityGroup.getId()));
@@ -4774,7 +4774,7 @@ private void checkIfHostNameUniqueInNtwkDomain(String hostName, List<NetworkVO>
47744774
List<String> hostNames = _vmInstanceDao.listDistinctHostNames(ntwkId);
47754775
// * verify that there are no duplicates
47764776
if (hostNames.contains(hostName)) {
4777-
throw new InvalidParameterValueException("The VM with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network="
4777+
throw new InvalidParameterValueException("The VM with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network = "
47784778
+ ((_networkModel.getNetwork(ntwkId) != null) ? _networkModel.getNetwork(ntwkId).getName() : "<unknown>"));
47794779
}
47804780
}
@@ -5899,7 +5899,7 @@ private Pod getDestinationPod(Long podId, boolean isRootAdmin) {
58995899
}
59005900
destinationPod = _podDao.findById(podId);
59015901
if (destinationPod == null) {
5902-
throw new InvalidParameterValueException("Unable to find the pod to deploy the VM, pod ID=" + podId);
5902+
throw new InvalidParameterValueException("Unable to find the pod to deploy the VM, pod ID = " + podId);
59035903
}
59045904
}
59055905
return destinationPod;
@@ -5914,7 +5914,7 @@ private Cluster getDestinationCluster(Long clusterId, boolean isRootAdmin) {
59145914
}
59155915
destinationCluster = _clusterDao.findById(clusterId);
59165916
if (destinationCluster == null) {
5917-
throw new InvalidParameterValueException("Unable to find the cluster to deploy the VM, cluster ID=" + clusterId);
5917+
throw new InvalidParameterValueException("Unable to find the cluster to deploy the VM, cluster ID = " + clusterId);
59185918
}
59195919
}
59205920
return destinationCluster;
@@ -5929,7 +5929,7 @@ private HostVO getDestinationHost(Long hostId, boolean isRootAdmin, boolean isEx
59295929
}
59305930
destinationHost = _hostDao.findById(hostId);
59315931
if (destinationHost == null) {
5932-
throw new InvalidParameterValueException("Unable to find the host to deploy the VM, host ID=" + hostId);
5932+
throw new InvalidParameterValueException("Unable to find the host to deploy the VM, host ID = " + hostId);
59335933
} else if (destinationHost.getResourceState() != ResourceState.Enabled || destinationHost.getStatus() != Status.Up ) {
59345934
throw new InvalidParameterValueException("Unable to deploy the VM as the host: " + destinationHost.getName() + " is not in the right state");
59355935
}
@@ -6996,7 +6996,7 @@ private VMInstanceVO preVmStorageMigrationCheck(Long vmId) {
69966996

69976997
VMInstanceVO vm = _vmInstanceDao.findById(vmId);
69986998
if (vm == null) {
6999-
throw new InvalidParameterValueException("Unable to find the VM by ID=" + vmId);
6999+
throw new InvalidParameterValueException("Unable to find the VM by ID = " + vmId);
70007000
}
70017001

70027002
if (vm.getState() != State.Stopped) {
@@ -7138,7 +7138,7 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr
71387138

71397139
VMInstanceVO vm = _vmInstanceDao.findById(vmId);
71407140
if (vm == null) {
7141-
throw new InvalidParameterValueException("Unable to find the VM by ID=" + vmId);
7141+
throw new InvalidParameterValueException("Unable to find the VM by ID = " + vmId);
71427142
}
71437143
// business logic
71447144
if (vm.getState() != State.Running) {
@@ -9021,7 +9021,7 @@ public Pair<UserVmVO, Volume> doInTransaction(final TransactionStatus status) th
90219021
}
90229022
} catch (Exception e) {
90239023
logger.debug("Unable to start VM " + vm.getUuid(), e);
9024-
CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM with specified ID" + e.getMessage());
9024+
CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM with specified ID." + e.getMessage());
90259025
ex.addProxyObject(vm.getUuid(), "vmId");
90269026
throw ex;
90279027
}

0 commit comments

Comments
 (0)