Don't double log API request
If debug logging is enabled the full API call, request and response is
logged, so don't log the request twice.
Change-Id: I45baa04a2daae8fd31c30183ac10464b7affbc21
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 00fe8d2..8227c89 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -16,6 +16,7 @@
import collections
import json
+import logging as real_logging
import re
import time
@@ -310,14 +311,15 @@
caller_name = misc_utils.find_test_caller()
if secs:
secs = " %.3fs" % secs
- self.LOG.info(
- 'Request (%s): %s %s %s%s' % (
- caller_name,
- resp['status'],
- method,
- req_url,
- secs),
- extra=extra)
+ if not self.LOG.isEnabledFor(real_logging.DEBUG):
+ self.LOG.info(
+ 'Request (%s): %s %s %s%s' % (
+ caller_name,
+ resp['status'],
+ method,
+ req_url,
+ secs),
+ extra=extra)
# Also look everything at DEBUG if you want to filter this
# out, don't run at debug.