mirror of https://github.com/docker/compose.git
Avoid modifying mutable default value
Rationale: http://effbot.org/zone/default-values.htm Signed-off-by: Emil Hessman <emil@hessman.se>
This commit is contained in:
parent
48a6f2132b
commit
15089886c2
|
@ -197,7 +197,9 @@ class Service(object):
|
|||
def __repr__(self):
|
||||
return '<Service: {}>'.format(self.name)
|
||||
|
||||
def containers(self, stopped=False, one_off=False, filters={}, labels=None):
|
||||
def containers(self, stopped=False, one_off=False, filters=None, labels=None):
|
||||
if filters is None:
|
||||
filters = {}
|
||||
filters.update({'label': self.labels(one_off=one_off) + (labels or [])})
|
||||
|
||||
result = list(filter(None, [
|
||||
|
|
Loading…
Reference in New Issue