Merge "Use a for loop to set the defaults for __call__ params"

This commit is contained in:
Jenkins 2014-05-15 22:29:07 +00:00 committed by Gerrit Code Review
commit 84887ccee3
1 changed files with 3 additions and 6 deletions

View File

@ -69,12 +69,9 @@ class Target(object):
self.fanout = fanout
def __call__(self, **kwargs):
kwargs.setdefault('exchange', self.exchange)
kwargs.setdefault('topic', self.topic)
kwargs.setdefault('namespace', self.namespace)
kwargs.setdefault('version', self.version)
kwargs.setdefault('server', self.server)
kwargs.setdefault('fanout', self.fanout)
for a in ('exchange', 'topic', 'namespace',
'version', 'server', 'fanout'):
kwargs.setdefault(a, getattr(self, a))
return Target(**kwargs)
def __eq__(self, other):