mirror of https://github.com/docker/compose.git
Support combination of shorthand flag and equal sign for host option
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
d0b46ca9b2
commit
11d8093fc8
|
@ -21,12 +21,15 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
def project_from_options(project_dir, options):
|
def project_from_options(project_dir, options):
|
||||||
environment = Environment.from_env_file(project_dir)
|
environment = Environment.from_env_file(project_dir)
|
||||||
|
host = options.get('--host')
|
||||||
|
if host is not None:
|
||||||
|
host = host.lstrip('=')
|
||||||
return get_project(
|
return get_project(
|
||||||
project_dir,
|
project_dir,
|
||||||
get_config_path_from_options(project_dir, options, environment),
|
get_config_path_from_options(project_dir, options, environment),
|
||||||
project_name=options.get('--project-name'),
|
project_name=options.get('--project-name'),
|
||||||
verbose=options.get('--verbose'),
|
verbose=options.get('--verbose'),
|
||||||
host=options.get('--host'),
|
host=host,
|
||||||
tls_config=tls_config_from_options(options),
|
tls_config=tls_config_from_options(options),
|
||||||
environment=environment
|
environment=environment
|
||||||
)
|
)
|
||||||
|
|
|
@ -145,6 +145,13 @@ class CLITestCase(DockerClientTestCase):
|
||||||
# Prevent tearDown from trying to create a project
|
# Prevent tearDown from trying to create a project
|
||||||
self.base_dir = None
|
self.base_dir = None
|
||||||
|
|
||||||
|
def test_shorthand_host_opt(self):
|
||||||
|
self.dispatch(
|
||||||
|
['-H={0}'.format(os.environ.get('DOCKER_HOST', 'unix://')),
|
||||||
|
'up', '-d'],
|
||||||
|
returncode=0
|
||||||
|
)
|
||||||
|
|
||||||
def test_config_list_services(self):
|
def test_config_list_services(self):
|
||||||
self.base_dir = 'tests/fixtures/v2-full'
|
self.base_dir = 'tests/fixtures/v2-full'
|
||||||
result = self.dispatch(['config', '--services'])
|
result = self.dispatch(['config', '--services'])
|
||||||
|
|
Loading…
Reference in New Issue