From 3700a9c367148a98d500cc653137dbc1006bdf92 Mon Sep 17 00:00:00 2001 From: Ji-Wei Date: Wed, 10 Jan 2018 14:37:52 +0800 Subject: [PATCH] Can not get a valid error message when executing zun attach error When 'zun attach' failed due to the low version of 'websocket-client' the log error message is TypeError: unsupported operand type(s) for %: 'error' and 'dict' Modified to make the error information readable. Change-Id: Ibcfa6f00d81af3c93828198b2914f1d46edbc7a2 Closes-Bug: #1742113 --- zun/common/exception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zun/common/exception.py b/zun/common/exception.py index c68c7248e..27433b284 100644 --- a/zun/common/exception.py +++ b/zun/common/exception.py @@ -201,7 +201,7 @@ class ZunException(Exception): self.message = message try: - self.message = self.message % kwargs + self.message = str(self.message) % kwargs except KeyError: # kwargs doesn't match a variable in the message # log the issue and the kwargs