Services have names

This commit is contained in:
Aanand Prasad 2013-12-09 12:19:27 +00:00
commit ffdebb84bb
2 changed files with 27 additions and 2 deletions

View file

@ -1,5 +1,12 @@
import re
class Service(object):
def __init__(self, client, image, command):
def __init__(self, name, client=None, image=None, command=None):
if not re.match('^[a-zA-Z0-9_]+$', name):
raise ValueError('Invalid name: %s' % name)
self.name = name
self.client = client
self.image = image
self.command = command