[PATCH] Allow log of failed callMethod() with callnum=None

Pavol Babincak pbabinca at redhat.com
Tue Apr 14 14:53:48 UTC 2015


Sometimes self.setSession(None) is called and this sets callnum = None.
Before this change code was failing with TypeError:

    TypeError: %d format: a number is required, not NoneType
---
 koji/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koji/__init__.py b/koji/__init__.py
index 24f0808..04b183e 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -1948,7 +1948,7 @@ class ClientSession(object):
                     if self.logger.isEnabledFor(logging.DEBUG):
                         tb_str = ''.join(traceback.format_exception(*sys.exc_info()))
                         self.logger.debug(tb_str)
-                    self.logger.info("Try #%d for call %d (%s) failed: %s", tries, self.callnum, name, e)
+                    self.logger.info("Try #%d for call %s (%s) failed: %s", tries, self.callnum, name, e)
                 if tries > 1:
                     # first retry is immediate, after that we honor retry_interval
                     time.sleep(interval)
-- 
1.9.3



More information about the buildsys mailing list