From c01f383ea0283ac864b3bde63b0f424783afd1a2 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 7 Nov 2019 15:14:13 +0100 Subject: [PATCH] container-puppet: update 'env' when not null Only update "env" if the content isn't null otherwise we'll have container configs with: "environment": null And it causes problem later when we manipulate the config. Change-Id: I0269a7ad0cf54e75dd25f8b3566ac0cab06fd93c --- common/container-puppet.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/common/container-puppet.py b/common/container-puppet.py index 94bbcc0efa..3b66542ed2 100755 --- a/common/container-puppet.py +++ b/common/container-puppet.py @@ -378,14 +378,11 @@ def infile_processing(infiles): ) # When python 27 support is removed, we will be able to use: # z = {**x, **y} to merge the dicts. - infile_data.get( - 'environment', - {} - ).update( + if infile_data.get('environment', None) is None: + infile_data['environment'] = {} + infile_data['environment'].update( {'TRIPLEO_CONFIG_HASH': config_hash} ) - env = infile_data.get('environment') - infile_data['environment'] = env outfile = os.path.join( os.path.dirname(