While creating a Template, the user can provide an ISO file or an Image
file. Kimchi relies on python magic to get the file mime type and it was
only considering ISO 9660 CD-ROM as valid for ISO images and it was fall
backing to an Image file and failing .
Add DOS/MBR as well to fix that problem.
Signed-off-by: Aline Manera <aline.manera(a)gmail.com>
---
model/templates.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/model/templates.py b/model/templates.py
index 566a20ce..c27e83f7 100644
--- a/model/templates.py
+++ b/model/templates.py
@@ -39,7 +39,7 @@ from wok.plugins.kimchi.utils import is_libvirtd_up, pool_name_from_uri
from wok.plugins.kimchi.utils import create_disk_image
from wok.plugins.kimchi.vmtemplate import VMTemplate
-ISO_TYPE = "ISO 9660 CD-ROM"
+ISO_TYPE = ["DOS/MBR", "ISO 9660 CD-ROM"]
# In PowerPC, memories must be aligned to 256 MiB
PPC_MEM_ALIGN = 256
# Max memory 16TB for PPC and 4TiB for X (according to Red Hat), in KiB
@@ -99,7 +99,8 @@ class TemplatesModel(object):
ftype = file_type.file(path)
# cdrom
- if ISO_TYPE in ftype:
+ iscdrom = [t for t in ISO_TYPE if t in ftype]
+ if iscdrom:
params["cdrom"] = path
# check search permission
--
2.13.6