From a51fc4633fa691ea27a5818f7750ebe8bb48d4f6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 1 Dec 2015 12:21:07 -0500 Subject: [PATCH] Fix ACI volumes Fixes #891 --- formats/aci.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/formats/aci.py b/formats/aci.py index 11a7a06ef..d23e0c3f1 100644 --- a/formats/aci.py +++ b/formats/aci.py @@ -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,