Resolves #927 - fix merging command line environment with a list in the config
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
8610adcaf3
commit
f47431d591
5 changed files with 103 additions and 45 deletions
|
|
@ -1,26 +1,25 @@
|
|||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from inspect import getdoc
|
||||
from operator import attrgetter
|
||||
import logging
|
||||
import sys
|
||||
import re
|
||||
import signal
|
||||
from operator import attrgetter
|
||||
import sys
|
||||
|
||||
from inspect import getdoc
|
||||
from docker.errors import APIError
|
||||
import dockerpty
|
||||
|
||||
from .. import __version__
|
||||
from ..project import NoSuchService, ConfigurationError
|
||||
from ..service import BuildError, CannotBeScaledError
|
||||
from ..service import BuildError, CannotBeScaledError, parse_environment
|
||||
from .command import Command
|
||||
from .docopt_command import NoSuchCommand
|
||||
from .errors import UserError
|
||||
from .formatter import Formatter
|
||||
from .log_printer import LogPrinter
|
||||
from .utils import yesno
|
||||
|
||||
from docker.errors import APIError
|
||||
from .errors import UserError
|
||||
from .docopt_command import NoSuchCommand
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
@ -316,11 +315,10 @@ class TopLevelCommand(Command):
|
|||
}
|
||||
|
||||
if options['-e']:
|
||||
for option in options['-e']:
|
||||
if 'environment' not in service.options:
|
||||
service.options['environment'] = {}
|
||||
k, v = option.split('=', 1)
|
||||
service.options['environment'][k] = v
|
||||
# Merge environment from config with -e command line
|
||||
container_options['environment'] = dict(
|
||||
parse_environment(service.options.get('environment')),
|
||||
**parse_environment(options['-e']))
|
||||
|
||||
if options['--entrypoint']:
|
||||
container_options['entrypoint'] = options.get('--entrypoint')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue