Merge pull request #1261 from aanand/fix-vars-in-volume-paths

Fix vars in volume paths
This commit is contained in:
Ben Firshman 2015-04-09 14:44:07 +01:00
commit 4926f8aef6
5 changed files with 35 additions and 18 deletions

View file

@ -329,6 +329,8 @@ def resolve_host_paths(volumes, working_dir=None):
def resolve_host_path(volume, working_dir):
container_path, host_path = split_volume(volume)
if host_path is not None:
host_path = os.path.expanduser(host_path)
host_path = os.path.expandvars(host_path)
return "%s:%s" % (expand_path(working_dir, host_path), container_path)
else:
return container_path

View file

@ -3,7 +3,6 @@ from __future__ import absolute_import
from collections import namedtuple
import logging
import re
import os
from operator import attrgetter
import sys
import six
@ -589,8 +588,7 @@ def parse_repository_tag(s):
def build_volume_binding(volume_spec):
internal = {'bind': volume_spec.internal, 'ro': volume_spec.mode == 'ro'}
external = os.path.expanduser(volume_spec.external)
return os.path.abspath(os.path.expandvars(external)), internal
return volume_spec.external, internal
def build_port_bindings(ports):