Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -975,36 +975,6 @@ protected void sendExceededBackupLimitAlert(String ownerUuid, Resource.ResourceT
message, message + " Please, use the 'updateResourceLimit' API to increase the backup limit.");
}

public List<BackupSchedule> listBackupSchedules(ListBackupScheduleCmd cmd) {
Account caller = CallContext.current().getCallingAccount();
Long id = cmd.getId();
Long vmId = cmd.getVmId();

if (vmId != null) {
final VMInstanceVO vm = findVmById(vmId);
validateBackupForZone(vm.getDataCenterId());
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
}

Filter searchFilter = new Filter(BackupScheduleVO.class, "id", true, null, null);
SearchBuilder<BackupScheduleVO> searchBuilder = backupScheduleDao.createSearchBuilder();
searchBuilder.and("id", searchBuilder.entity().getId(), SearchCriteria.Op.EQ);
if (vmId != null) {
searchBuilder.and("vmId", searchBuilder.entity().getVmId(), SearchCriteria.Op.EQ);
}

SearchCriteria<BackupScheduleVO> sc = searchBuilder.create();
if (id != null) {
sc.setParameters("id", id);
}
if (vmId != null) {
sc.setParameters("vmId", vmId);
}

Pair<List<BackupScheduleVO>, Integer> result = backupScheduleDao.searchAndCount(sc, searchFilter);
return new ArrayList<>(result.first());
}

/**
* Gets the backup schedule ID from the async job's payload.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private void updateTaskDescriptionWithV2KStatus(ImportVMTaskResponse response, I
}

private void cleanupAblestackV2KDomain(ImportVMTaskVO task) {
if (task == null || task.getConvertHostId() == null || StringUtils.isBlank(task.getSourceVMName())) {
if (task == null || task.getConvertHostId() <= 0 || StringUtils.isBlank(task.getSourceVMName())) {
return;
}
HostVO convertHost = hostDao.findById(task.getConvertHostId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@ protected void cleanupAblestackV2KDomain(ImportVMTaskVO task, HostVO convertHost
}

protected void cleanupAblestackV2KDomain(ImportVMTaskVO task) {
if (task == null || task.getConvertHostId() == null) {
if (task == null || task.getConvertHostId() <= 0) {
return;
}
HostVO convertHost = hostDao.findById(task.getConvertHostId());
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ fetch('config.json?ts=' + Date.now())
})
}).catch(error => {
renderError(error)
})
})
Loading