mirror of
https://github.com/Red5d/docker-autocompose
synced 2026-01-03 07:08:01 +00:00
command property: replace string concatenation by taking over given list
This commit is contained in:
@@ -94,12 +94,12 @@ def generate(cname):
|
|||||||
networks[network.attrs['Name']] = {'external': (not network.attrs['Internal'])}
|
networks[network.attrs['Name']] = {'external': (not network.attrs['Internal'])}
|
||||||
|
|
||||||
# Check for command and add it if present.
|
# Check for command and add it if present.
|
||||||
if cattrs['Config']['Cmd'] != None:
|
if cattrs['Config']['Cmd'] is not None:
|
||||||
values['command'] = " ".join(cattrs['Config']['Cmd']),
|
values['command'] = cattrs['Config']['Cmd']
|
||||||
|
|
||||||
# Check for exposed/bound ports and add them if needed.
|
# Check for exposed/bound ports and add them if needed.
|
||||||
try:
|
try:
|
||||||
expose_value = list(cattrs['Config']['ExposedPorts'].keys())
|
expose_value = list(cattrs['Config']['ExposedPorts'].keys())
|
||||||
ports_value = [cattrs['HostConfig']['PortBindings'][key][0]['HostIp']+':'+cattrs['HostConfig']['PortBindings'][key][0]['HostPort']+':'+key for key in cattrs['HostConfig']['PortBindings']]
|
ports_value = [cattrs['HostConfig']['PortBindings'][key][0]['HostIp']+':'+cattrs['HostConfig']['PortBindings'][key][0]['HostPort']+':'+key for key in cattrs['HostConfig']['PortBindings']]
|
||||||
|
|
||||||
# If bound ports found, don't use the 'expose' value.
|
# If bound ports found, don't use the 'expose' value.
|
||||||
|
|||||||
Reference in New Issue
Block a user