Prevent null logging options in `docker-compose config` output

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-08-10 10:59:23 -07:00 committed by Joffrey F
parent b893797e03
commit b2a3566cf5
2 changed files with 2 additions and 3 deletions

View File

@ -1044,8 +1044,8 @@ def merge_logging(base, override):
md.merge_scalar('driver')
if md.get('driver') == base.get('driver') or base.get('driver') is None:
md.merge_mapping('options', lambda m: m or {})
else:
md['options'] = override.get('options')
elif override.get('options'):
md['options'] = override.get('options', {})
return dict(md)

View File

@ -1864,7 +1864,6 @@ class ConfigTest(unittest.TestCase):
'image': 'alpine:edge',
'logging': {
'driver': 'syslog',
'options': None
}
}