Show a nicer error when the env file doesn't exist

Closes #865

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-01-28 16:01:48 -05:00
commit de07e0471e
2 changed files with 8 additions and 0 deletions

View file

@ -95,6 +95,10 @@ class Service(object):
if 'image' in options and 'build' in options:
raise ConfigError('Service %s has both an image and build path specified. A service can either be built to image or use an existing image, not both.' % name)
for filename in get_env_files(options):
if not os.path.exists(filename):
raise ConfigError("Couldn't find env file for service %s: %s" % (name, filename))
supported_options = DOCKER_CONFIG_KEYS + ['build', 'expose',
'external_links']