ctrl2cgi.py: log address on errors

Change-Id: I80cdcda134766c679c2b80b848fb9db853321cfd
Related: SYS#4399
This commit is contained in:
Max 2018-11-22 18:45:21 +01:00
parent dbb57eb57d
commit c16fa3c750
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ class Trap(CTRL):
params['h'] = gen_hash(params, self.factory.secret_key)
d = post(self.factory.location, None, params=params)
d.addCallback(partial(handle_reply, self.transport.write, self.factory.log)) # treq's collect helper is handy to get all reply content at once using closure on ctx
d.addErrback(lambda e, bsc: self.factory.log.critical("HTTP POST error %s while trying to register BSC %s" % (e, bsc)), bsc) # handle HTTP errors
d.addErrback(lambda e, bsc: self.factory.log.critical("HTTP POST error %s while trying to register BSC %s on %s" % (e, bsc, self.factory.location)), bsc) # handle HTTP errors
# Ensure that we run only limited number of requests in parallel:
yield self.factory.semaphore.acquire()
yield d # we end up here only if semaphore is available which means it's ok to fire the request without exceeding the limit