Skip to content

Commit 2b2d5fa

Browse files
author
Daan Hoogland
committed
address suggestions and fix double quote
1 parent 4252f18 commit 2b2d5fa

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,10 +2478,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
24782478
int _usageAggregationRange = NumbersUtil.parseInt(aggregationRange, 1440);
24792479
int HOURLY_TIME = 60;
24802480
final int DAILY_TIME = 60 * 24;
2481-
if (_usageAggregationRange == DAILY_TIME) {
2482-
_dailyOrHourly = true;
2483-
} else _dailyOrHourly = _usageAggregationRange == HOURLY_TIME;
2484-
2481+
_dailyOrHourly = (_usageAggregationRange == DAILY_TIME || _usageAggregationRange == HOURLY_TIME);
24852482
_itMgr.registerGuru(VirtualMachine.Type.User, this);
24862483

24872484
VirtualMachine.State.getStateMachine().registerListener(new UserVmStateListener(_usageEventDao, _networkDao, _nicDao, serviceOfferingDao, _vmDao, this, _configDao));
@@ -3472,12 +3469,12 @@ public UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityE
34723469
throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId + " corresponding to the Instance");
34733470
}
34743471

3475-
Boolean enterSetup = cmd.getBootIntoSetup();
3476-
if (enterSetup != null && enterSetup && !HypervisorType.VMware.equals(vmInstance.getHypervisorType())) {
3472+
boolean enterSetup = Boolean.TRUE.equals(cmd.getBootIntoSetup());
3473+
if (enterSetup && !HypervisorType.VMware.equals(vmInstance.getHypervisorType())) {
34773474
throw new InvalidParameterValueException("Booting into a hardware setup menu is not implemented on " + vmInstance.getHypervisorType());
34783475
}
34793476

3480-
UserVm userVm = rebootVirtualMachine(vmId, enterSetup != null && cmd.getBootIntoSetup(), cmd.isForced());
3477+
UserVm userVm = rebootVirtualMachine(vmId, cmd.getBootIntoSetup(), cmd.isForced());
34813478
if (userVm != null ) {
34823479
// update the vmIdCountMap if the vm is in advanced shared network with out services
34833480
final List<NicVO> nics = _nicDao.listByVmId(vmId);
@@ -4860,7 +4857,7 @@ private UserVmVO commitUserVm(final boolean isImport, final DataCenter zone, fin
48604857
validateRootDiskResize(hypervisorType, rootDiskSize, templateVO, vm, customParameters);
48614858
}
48624859

4863-
vm.setDisplayVm(isDisplayVm == null || isDisplayVm);
4860+
vm.setDisplayVm(!Boolean.FALSE.equals(isDisplayVm));
48644861

48654862
setVmRequiredFieldsForImport(isImport, vm, zone, hypervisorType, host, lastHost, powerState);
48664863

@@ -5363,7 +5360,7 @@ private void addUserVMCmdlineArgs(Long vmId, VirtualMachineProfile profile, Depl
53635360
if (dc.getDns2() != null) {
53645361
buf.append(" dns2=").append(dc.getDns2());
53655362
}
5366-
logger.info("cmdline details: {}, buf);
5363+
logger.info("cmdline details: {}", buf);
53675364
}
53685365

53695366
@Override

0 commit comments

Comments
 (0)