The same applies to procedures - don't dump context as a JSON in case of exceptions

This commit is contained in:
Fabio Manganiello 2021-03-05 19:00:26 +01:00
parent 04ff008800
commit 36aee6f787

View file

@ -1,5 +1,4 @@
import enum
import json
import logging
import re
from functools import wraps
@ -345,7 +344,7 @@ class WhileProcedure(LoopProcedure):
context[k] = eval('"{}"'.format(re.sub(r'(^|[^\\])"', '\1\\"', v)))
except Exception as e:
logger.warning('Could not parse value for context variable {}={}'.format(k, v))
logger.warning('Context: {}'.format(json.dumps(context)))
logger.warning('Context: {}'.format(context))
logger.exception(e)
return context
@ -460,7 +459,7 @@ class IfProcedure(Procedure):
exec('{}="{}"'.format(k, re.sub(r'(^|[^\\])"', '\1\\"', v)))
except Exception as e:
logger.warning('Could not set context variable {}={}'.format(k, v))
logger.warning('Context: {}'.format(json.dumps(context)))
logger.warning('Context: {}'.format(context))
logger.exception(e)
condition_true = eval(self.condition)