I added checksum key instead of md5sum key

This commit is contained in:
Rajnikant 2022-04-28 17:55:15 +05:30
parent 0df6294cc7
commit a7e637a466
2 changed files with 29 additions and 24 deletions

View File

@ -409,11 +409,11 @@ export class NewTemplateDialogComponent implements OnInit {
checkImageFromVersion(image: string): boolean { checkImageFromVersion(image: string): boolean {
let imageToInstall = this.applianceToInstall.images.filter((n) => n.filename === image)[0]; let imageToInstall = this.applianceToInstall.images.filter((n) => n.filename === image)[0];
if (this.applianceToInstall.qemu) { if (this.applianceToInstall.qemu) {
if (this.qemuImages.filter((n) => n.md5sum === imageToInstall.md5sum).length > 0) return true; if (this.qemuImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
} else if (this.applianceToInstall.dynamips) { } else if (this.applianceToInstall.dynamips) {
if (this.iosImages.filter((n) => n.md5sum === imageToInstall.md5sum).length > 0) return true; if (this.iosImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
} else if (this.applianceToInstall.iou) { } else if (this.applianceToInstall.iou) {
if (this.iouImages.filter((n) => n.md5sum === imageToInstall.md5sum).length > 0) return true; if (this.iouImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
} }
return false; return false;
@ -429,9 +429,12 @@ export class NewTemplateDialogComponent implements OnInit {
return false; return false;
} }
if (this.checkImageFromVersion(version.images.hda_disk_image)) return true; if (this.checkImageFromVersion(version.images.hda_disk_image)) {
return true;
} else {
return false; return false;
} }
}
openConfirmationDialog(message: string, link: string) { openConfirmationDialog(message: string, link: string) {
const dialogRef = this.dialog.open(InformationDialogComponent, { const dialogRef = this.dialog.open(InformationDialogComponent, {
@ -607,6 +610,7 @@ export class NewTemplateDialogComponent implements OnInit {
} }
createQemuTemplateFromVersion(version: Version) { createQemuTemplateFromVersion(version: Version) {
debugger
if (!this.checkImages(version)) { if (!this.checkImages(version)) {
this.toasterService.error('Please install required images first'); this.toasterService.error('Please install required images first');
return; return;

View File

@ -5,6 +5,7 @@ export interface Image {
filename: string; filename: string;
filesize: any; filesize: any;
md5sum: string; md5sum: string;
checksum: string;
version: string; version: string;
} }