fix logging-too-few-args errors

This commit is contained in:
Job Evers-Meltzer 2016-05-31 22:49:00 -05:00
parent 9f0f9e0928
commit 284d307c0f
2 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@ class DownloadManager(object):
def check_stop(result, manager):
if isinstance(result, failure.Failure):
log.error("Failed to stop the %s: %s", manager. result.getErrorMessage())
log.error("Failed to stop the %s: %s", manager, result.getErrorMessage())
return False
return True
@ -115,4 +115,4 @@ class DownloadManager(object):
if not self.blobs:
return self.calculate_total_bytes()
else:
return sum([b.length for b in self.needed_blobs() if b.length is not None])
return sum([b.length for b in self.needed_blobs() if b.length is not None])

View file

@ -101,7 +101,7 @@ class ValuableBlobHashQueryHandler(ValuableQueryHandler):
for blob_hash, count in valuable_hashes:
hashes_and_scores.append((blob_hash, 1.0 * count / 10.0))
if len(hashes_and_scores) != 0:
log.info("Responding to a valuable blob hashes request with %s blob hashes: %s",
log.info("Responding to a valuable blob hashes request with %s blob hashes",
str(len(hashes_and_scores)))
expected_payment = 1.0 * len(hashes_and_scores) * self.valuable_blob_hash_payment_rate / 1000.0
self.wallet.add_expected_payment(self.peer, expected_payment)
@ -193,10 +193,10 @@ class ValuableBlobLengthQueryHandler(ValuableQueryHandler):
if success is True:
lengths.append(response_pair)
if len(lengths) > 0:
log.info("Responding with %s blob lengths: %s", str(len(lengths)))
log.info("Responding with %s blob lengths", str(len(lengths)))
expected_payment = 1.0 * len(lengths) * self.blob_length_payment_rate / 1000.0
self.wallet.add_expected_payment(self.peer, expected_payment)
self.peer.update_stats('uploaded_valuable_blob_infos', len(lengths))
return {'blob_length': {'blob_lengths': lengths}}
dl.addCallback(make_response)
dl.addCallback(make_response)