mirror of https://github.com/docker/compose.git
Merge pull request #6236 from ceh-forks/mutable-default-values
Avoid modifying mutable default value
This commit is contained in:
commit
5629f62644
|
@ -197,7 +197,9 @@ class Service(object):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Service: {}>'.format(self.name)
|
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 [])})
|
filters.update({'label': self.labels(one_off=one_off) + (labels or [])})
|
||||||
|
|
||||||
result = list(filter(None, [
|
result = list(filter(None, [
|
||||||
|
|
Loading…
Reference in New Issue