Fix for #1224, check that image or build is specified

Signed-off-by: Michael Chase-Salerno <bratac@linux.vnet.ibm.com>
This commit is contained in:
Michael Chase-Salerno 2015-04-15 02:03:02 +00:00
commit 15b763acdb
3 changed files with 30 additions and 14 deletions

View file

@ -60,6 +60,8 @@ class Service(object):
raise ConfigError('Invalid project name "%s" - only %s are allowed' % (project, VALID_NAME_CHARS))
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)
if 'image' not in options and 'build' not in options:
raise ConfigError('Service %s has neither an image nor a build path specified. Exactly one must be provided.' % name)
self.name = name
self.client = client