Merge pull request #42745 from terminalmage/issue42705

docker.compare_container: treat null oom_kill_disable as False
This commit is contained in:
garethgreenaway 2017-08-05 08:28:19 -07:00 committed by GitHub
commit 1b3407649b

View File

@ -899,11 +899,15 @@ def compare_container(first, second, ignore=None):
continue
val1 = result1[conf_dict][item]
val2 = result2[conf_dict].get(item)
if item == 'Links':
val1 = _scrub_links(val1, first)
val2 = _scrub_links(val2, second)
if val1 != val2:
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
if item in ('OomKillDisable',):
if bool(val1) != bool(val2):
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
else:
if item == 'Links':
val1 = _scrub_links(val1, first)
val2 = _scrub_links(val2, second)
if val1 != val2:
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
# Check for optionally-present items that were in the second container
# and not the first.
for item in result2[conf_dict]:
@ -913,11 +917,15 @@ def compare_container(first, second, ignore=None):
continue
val1 = result1[conf_dict].get(item)
val2 = result2[conf_dict][item]
if item == 'Links':
val1 = _scrub_links(val1, first)
val2 = _scrub_links(val2, second)
if val1 != val2:
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
if item in ('OomKillDisable',):
if bool(val1) != bool(val2):
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
else:
if item == 'Links':
val1 = _scrub_links(val1, first)
val2 = _scrub_links(val2, second)
if val1 != val2:
ret.setdefault(conf_dict, {})[item] = {'old': val1, 'new': val2}
return ret