From 6f431551d362eb1567c73b75f053f878144035b5 Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Tue, 4 Dec 2018 10:02:40 +0300 Subject: [PATCH] Add condition for %env section backward compatibility Change-Id: I5281f4ec6359f0e3f582ad1cfc6939da4ff134a3 Signed-off-by: Slava Barinov --- kickstart/kickstart.tmpl | 2 ++ kswriter/KSWriter.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kickstart/kickstart.tmpl b/kickstart/kickstart.tmpl index 54c9a8b..52c8aae 100644 --- a/kickstart/kickstart.tmpl +++ b/kickstart/kickstart.tmpl @@ -87,9 +87,11 @@ repo --name=${r} --baseurl=${rr.Url} ${options_repo} #end for #end for +#if $metadata.has_key("Env") %env ${metadata.Env} %end +#endif #if $metadata.has_key("PackageArgs") %packages --${metadata.PackageArgs} diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py index a15ed63..9449eb4 100644 --- a/kswriter/KSWriter.py +++ b/kswriter/KSWriter.py @@ -166,7 +166,8 @@ class KSWriter(): conf['Post'] = postscript conf['NoChroot'] = nochrootscript conf['Run'] = runscript - conf['Env'] = envscript + if envscript: + conf['Env'] = envscript return conf def process_files(self, meta, repos): -- 2.7.4