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 <bdobreli@redhat.com>
(cherry picked from commit 5558e521ab)
(cherry picked from commit e52fdc0854)
This commit is contained in:
Bogdan Dobrelya 2019-01-11 12:35:36 +01:00 committed by Alex Schultz
parent 4e21b9dc4e
commit 9d38fc8344
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@
import json
import logging
import tenacity
import yaml
LOG = logging.getLogger(__name__)
@ -101,7 +102,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