mirror of
https://github.com/Red5d/docker-autocompose
synced 2026-01-03 07:08:01 +00:00
Exclude the 'networks' key if only the default bridge network is present
This commit is contained in:
@@ -60,7 +60,7 @@ def generate(cname):
|
||||
#'log_driver': cattrs['HostConfig']['LogConfig']['Type'],
|
||||
#'log_opt': cattrs['HostConfig']['LogConfig']['Config'],
|
||||
'logging': {'driver': cattrs['HostConfig']['LogConfig']['Type'], 'options': cattrs['HostConfig']['LogConfig']['Config']},
|
||||
'networks': {x for x in cattrs['NetworkSettings']['Networks'].keys()},
|
||||
'networks': {x for x in cattrs['NetworkSettings']['Networks'].keys() if x != 'bridge'},
|
||||
'security_opt': cattrs['HostConfig']['SecurityOpt'],
|
||||
'ulimits': cattrs['HostConfig']['Ulimits'],
|
||||
'volumes': cattrs['HostConfig']['Binds'],
|
||||
@@ -80,6 +80,9 @@ def generate(cname):
|
||||
'tty': cattrs['Config']['Tty']
|
||||
}
|
||||
|
||||
if values['networks'] == set():
|
||||
del values['networks']
|
||||
|
||||
networklist = c.networks.list()
|
||||
networks = {}
|
||||
for network in networklist:
|
||||
|
||||
Reference in New Issue
Block a user