From f5e406053323cc428328b5cd4a645a2fa656458a Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Tue, 31 Aug 2021 13:35:59 +0300 Subject: [PATCH] Correctly create DIB_ENV variable and dib_environment file The DIB_ENV variable can contain multiline content, for example at least DIB_BLOCK_DEVICE_CONFIG is a multiline YAML data [1], so for this type of content the variable created with incomplete data, also this incomple data echoed [2] when creating the dib_environment file which creates an unusable file. This change fixes the issue. 1. https://github.com/openstack/diskimage-builder/blob/79ea63f5251f6f9a11d1a26537cd2c76389d2d66/doc/source/user_guide/building_an_image.rst#disk-image-layout 2. https://github.com/openstack/diskimage-builder/blob/79ea63f5251f6f9a11d1a26537cd2c76389d2d66/diskimage_builder/elements/manifests/cleanup.d/01-copy-manifests-dir#L32 Change-Id: I3b74ede69eb064ad813a9108ec68a228e549e8bb Signed-off-by: Maksim Malchuk --- diskimage_builder/lib/disk-image-create | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index 80fc8fc6..4fb810b4 100644 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -26,7 +26,7 @@ export LC_ALL=C # Store our initial environment and command line args for later export DIB_ARGS="$@" -export DIB_ENV=$(export | grep ' DIB_.*=') +export DIB_ENV=$(declare -p $(compgen -v | grep '^DIB_')) SCRIPTNAME=$(basename $0)