From 7b049ab00572f184c615757949f5d6e42f130748 Mon Sep 17 00:00:00 2001 From: Katarzyna Gorska Date: Tue, 29 Aug 2017 14:02:11 +0200 Subject: [PATCH] Add possibility to parse list of partition files Kickstarter was not able to correctly parse config files that contained a list of partition files in "Part" section. Now it is possible to add several partition files in that section. Change-Id: I723769ef8326576e52205850eca7f69bc6aa9472 Signed-off-by: Katarzyna Gorska --- kswriter/KSWriter.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py index b5e97a3..bae1e36 100644 --- a/kswriter/KSWriter.py +++ b/kswriter/KSWriter.py @@ -138,9 +138,19 @@ class KSWriter(): ptab = "" for g in [ plat, img ]: if g.has_key("Part"): - f = open("%s/partitions/%s" %(meta_root, g['Part']) ) - ptab = f.read() - f.close() + if type(g['Part']) == str: + t = [g['Part']] + elif type(g['Part']) == list: + t = g['Part'] + ptab = "" + for p in t: + if os.path.exists('%s/partitions/%s' %(meta_root,p)): + f = open("%s/partitions/%s" %(meta_root, p) ) + ptab += f.read() + ptab += "\n" + f.close() + else: + raise KSMetaError('%s/partitions/%s.run not found, aborting.' %(meta_root,p)) conf['Part'] = ptab conf['Post'] = postscript -- 2.7.4