Merge pull request #1007 from coreos-inc/acivolumes

Fix ACI volumes
This commit is contained in:
josephschorr 2015-12-01 15:05:58 -05:00
commit 8afb4691a5

View file

@ -84,7 +84,7 @@ class ACIImage(TarImageFormatter):
""" Builds the ports definitions for the ACI. """
ports = []
for docker_port_definition in docker_config.get('ports', {}):
for docker_port_definition in docker_config.get('ports', docker_config.get('Ports', {})):
# Formats:
# port/tcp
# port/udp
@ -117,20 +117,12 @@ class ACIImage(TarImageFormatter):
names = set()
def get_name(docker_volume_path):
parts = docker_volume_path.split('/')
name = ''
return "volume-%s" % docker_volume_path.replace('/', '-')
while True:
name = name + parts[-1]
parts = parts[0:-1]
if names.add(name):
break
for docker_volume_path in docker_config.get('volumes', docker_config.get('Volumes', {})):
if not docker_volume_path:
continue
name = '/' + name
return name.lower()
for docker_volume_path in docker_config.get('volumes', {}):
volumes.append({
"name": get_name(docker_volume_path),
"path": docker_volume_path,