From e52fdc085412b7631364b1c93c98a5e5a25d4320 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Fri, 11 Jan 2019 12:35:36 +0100 Subject: [PATCH] Fix comparing dictionaries for changes detection Non-unicode and unicode dicts cannot be compared. That makes paunch failing to detect config changes and rebuilding containers w/o a need. Use yaml safe_load in order to produce a non-unicode dict for the right comparison of config data. NOTE: This change is different for <= Rocky as we refactored in Stein. Conflicts: paunch/builder/base.py Change-Id: I507f4b07af2c515fd8548af7dbe6b35ad2a269a9 Closes-Bug: #1810690 Signed-off-by: Bogdan Dobrelya (cherry picked from commit 5558e521abc48f5cf1bd3fcfdaec1149a05dcfaa) --- paunch/builder/compose1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paunch/builder/compose1.py b/paunch/builder/compose1.py index 1e0d718..882b92b 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -15,6 +15,7 @@ import json import logging import re import tenacity +import yaml LOG = logging.getLogger(__name__) @@ -102,7 +103,7 @@ class ComposeV1Builder(object): continue try: - ex_data = json.loads(ex_data_str) + ex_data = yaml.safe_load(str(ex_data_str)) except Exception: ex_data = None