Services have names
This commit is contained in:
parent
83a086b865
commit
ffdebb84bb
2 changed files with 27 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue