Do not allow underscores in names

This commit is contained in:
Ben Firshman 2013-12-19 14:47:43 +00:00
commit 6c551a200b
2 changed files with 6 additions and 6 deletions

View file

@ -13,7 +13,7 @@ class BuildError(Exception):
class Service(object):
def __init__(self, name, client=None, links=[], **options):
if not re.match('^[a-zA-Z0-9_]+$', name):
if not re.match('^[a-zA-Z0-9]+$', name):
raise ValueError('Invalid name: %s' % name)
if 'image' in options and 'build' in options:
raise ValueError('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)