Skip to content

Commit ff826f9

Browse files
author
Daan Hoogland
committed
address suggestions and fix double quote
1 parent a310ee2 commit ff826f9

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,10 +2426,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
24262426
int _usageAggregationRange = NumbersUtil.parseInt(aggregationRange, 1440);
24272427
int HOURLY_TIME = 60;
24282428
final int DAILY_TIME = 60 * 24;
2429-
if (_usageAggregationRange == DAILY_TIME) {
2430-
_dailyOrHourly = true;
2431-
} else _dailyOrHourly = _usageAggregationRange == HOURLY_TIME;
2432-
2429+
_dailyOrHourly = (_usageAggregationRange == DAILY_TIME || _usageAggregationRange == HOURLY_TIME);
24332430
_itMgr.registerGuru(VirtualMachine.Type.User, this);
24342431

24352432
VirtualMachine.State.getStateMachine().registerListener(new UserVmStateListener(_usageEventDao, _networkDao, _nicDao, serviceOfferingDao, _vmDao, this, _configDao));
@@ -3406,12 +3403,12 @@ public UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityE
34063403
throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId + " corresponding to the Instance");
34073404
}
34083405

3409-
Boolean enterSetup = cmd.getBootIntoSetup();
3410-
if (enterSetup != null && enterSetup && !HypervisorType.VMware.equals(vmInstance.getHypervisorType())) {
3406+
boolean enterSetup = Boolean.TRUE.equals(cmd.getBootIntoSetup());
3407+
if (enterSetup && !HypervisorType.VMware.equals(vmInstance.getHypervisorType())) {
34113408
throw new InvalidParameterValueException("Booting into a hardware setup menu is not implemented on " + vmInstance.getHypervisorType());
34123409
}
34133410

3414-
UserVm userVm = rebootVirtualMachine(vmId, enterSetup != null && cmd.getBootIntoSetup(), cmd.isForced());
3411+
UserVm userVm = rebootVirtualMachine(vmId, cmd.getBootIntoSetup(), cmd.isForced());
34153412
if (userVm != null ) {
34163413
// update the vmIdCountMap if the vm is in advanced shared network with out services
34173414
final List<NicVO> nics = _nicDao.listByVmId(vmId);
@@ -4795,7 +4792,7 @@ private UserVmVO commitUserVm(final boolean isImport, final DataCenter zone, fin
47954792
validateRootDiskResize(hypervisorType, rootDiskSize, templateVO, vm, customParameters);
47964793
}
47974794

4798-
vm.setDisplayVm(isDisplayVm == null || isDisplayVm);
4795+
vm.setDisplayVm(!Boolean.FALSE.equals(isDisplayVm));
47994796

48004797
setVmRequiredFieldsForImport(isImport, vm, zone, hypervisorType, host, lastHost, powerState);
48014798

@@ -5298,7 +5295,7 @@ private void addUserVMCmdlineArgs(Long vmId, VirtualMachineProfile profile, Depl
52985295
if (dc.getDns2() != null) {
52995296
buf.append(" dns2=").append(dc.getDns2());
53005297
}
5301-
logger.info("cmdline details: {}, buf);
5298+
logger.info("cmdline details: {}", buf);
53025299
}
53035300

53045301
@Override

0 commit comments

Comments
 (0)