You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.4 KiB
34 lines
1.4 KiB
From c3b6e3d0bab224b1bf829c7e16a16a4fdfb1bf7a Mon Sep 17 00:00:00 2001
|
|
From: Tomas Kopecek <tkopecek@redhat.com>
|
|
Date: Thu, 10 Nov 2022 10:42:30 +0100
|
|
Subject: [PATCH 6/6] better error for wrong include xml format
|
|
|
|
(cherry picked from commit 8b1030f8635ba2688630adf951ac849197c19cd8)
|
|
---
|
|
plugins/builder/kiwi.py | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py
|
|
index 4033b520..bc216c2e 100644
|
|
--- a/plugins/builder/kiwi.py
|
|
+++ b/plugins/builder/kiwi.py
|
|
@@ -204,9 +204,12 @@ class KiwiCreateImageTask(BaseBuildTask):
|
|
raise koji.GenericError(f"Unhandled include protocol in include path: {path}.")
|
|
inc = xml.dom.minidom.parse(path) # nosec
|
|
# every included xml has image root element again
|
|
- for node in list(inc.getElementsByTagName('image')[0].childNodes):
|
|
- if node.nodeName != 'repository':
|
|
- image.appendChild(node)
|
|
+ try:
|
|
+ for node in list(inc.getElementsByTagName('image')[0].childNodes):
|
|
+ if node.nodeName != 'repository':
|
|
+ image.appendChild(node)
|
|
+ except IndexError:
|
|
+ raise koji.GenericError("Included file needs to contain <image> tag.")
|
|
image.removeChild(inc_node)
|
|
|
|
# remove remaining old repos
|
|
--
|
|
2.38.1
|
|
|