Prevent KeyError when remote network labels are None.

Signed-off-by: Danil Kister <danil.kister@gmail.com>
This commit is contained in:
Danil Kister 2019-08-21 18:51:44 +02:00
parent 525bc9ef7a
commit a5fbf91b72
2 changed files with 6 additions and 1 deletions

View file

@ -226,7 +226,7 @@ def check_remote_network_config(remote, local):
raise NetworkConfigChangedError(local.true_name, 'enable_ipv6')
local_labels = local.labels or {}
remote_labels = remote.get('Labels', {})
remote_labels = remote.get('Labels') or {}
for k in set.union(set(remote_labels.keys()), set(local_labels.keys())):
if k.startswith('com.docker.'): # We are only interested in user-specified labels
continue