Spike: Add 'auto_start' option to fig.yml

Signed-off-by: Chris Corbyn <chris@w3style.co.uk>
This commit is contained in:
d11wtq 2014-06-07 08:22:27 +00:00 • committed by Chris Corbyn
commit 8b4ed0c1a8
2 changed files with 12 additions and 5 deletions

View file

@ -37,7 +37,7 @@ class ConfigError(ValueError):
class Service(object):
def __init__(self, name, client=None, project='default', links=[], **options):
def __init__(self, name, auto_start=True, client=None, project='default', links=[], **options):
if not re.match('^[a-zA-Z0-9]+$', name):
raise ConfigError('Invalid name: %s' % name)
if not re.match('^[a-zA-Z0-9]+$', project):
@ -45,7 +45,7 @@ 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)
supported_options = DOCKER_CONFIG_KEYS + ['build', 'expose']
supported_options = DOCKER_CONFIG_KEYS + ['auto_start', 'build', 'expose']
for k in options:
if k not in supported_options:
@ -55,6 +55,7 @@ class Service(object):
raise ConfigError(msg)
self.name = name
self.auto_start = auto_start
self.client = client
self.project = project
self.links = links or []