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.

Change-Id: I507f4b07af2c515fd8548af7dbe6b35ad2a269a9
Closes-Bug: #1810690
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-01-11 12:35:36 +01:00
parent 99ac720bf6
commit 5558e521ab
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import json
import re
import shutil
import tenacity
import yaml
from paunch.utils import common
from paunch.utils import systemd
@ -133,7 +134,7 @@ class BaseBuilder(object):
continue
try:
ex_data = json.loads(str(ex_data_str))
ex_data = yaml.safe_load(str(ex_data_str))
except Exception:
ex_data = None