[Kimchi-devel] [PATCH] [Wok] Issue #190: No activity logging is shown and its break if any one entry in activity log does not have proper key

Lucio Correia luciojhc at linux.vnet.ibm.com
Thu Dec 8 16:42:15 UTC 2016


This is useful to make development more efficient, to not
be blocked on that kind of issues.

On the other hand it will hide messages that need fix on
parameter improvements, but as a development tool it will
allow to find those messages.

In summary, this patch has more benefits.

Reviewed-By: Lucio Correia <luciojhc at linux.vnet.ibm.com>

On 08/12/2016 08:19, archus at linux.vnet.ibm.com wrote:
> From: Archana Singh <archus at linux.vnet.ibm.com>
>
> Currently activity logs breaks in UI, if an error code is
> changed with additional parameter. For example an error code does not have
> any parameter and its logged in user-requests.data with params as empty.
> And however same error code is changed to have a parameter, and hence while parsing
> activity log it is expected to have parameter in params.
> Due to which parsing fails with KeyError.
> This fix handle the KeyError and in case of KeyError the error message will
> be shown without replacing the parameter with its value.
>
> Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
> ---
>  src/wok/message.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/wok/message.py b/src/wok/message.py
> index ff4cbc9..460d90d 100644
> --- a/src/wok/message.py
> +++ b/src/wok/message.py
> @@ -86,7 +86,10 @@ class WokMessage(object):
>
>      def get_text(self, prepend_code=True, translate=True):
>          msg = self._get_text(translate)
> -        msg = decode_value(msg) % self.args
> +        try:
> +            msg = decode_value(msg) % self.args
> +        except KeyError:
> +            msg = decode_value(msg)
>
>          if prepend_code:
>              return "%s: %s" % (self.code, msg)
>


-- 
Lucio Correia
Software Engineer
IBM LTC Brazil




More information about the Kimchi-devel mailing list