| Filip Pytloun | 5a586cb | 2015-10-16 21:01:08 +0200 | [diff] [blame] | 1 | From fbd22d42a20a0fdd53bc42fd27ad9f3d6af70f80 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Kuty <6du1ro.n@gmail.com> |
| 3 | Date: Fri, 16 Oct 2015 18:10:18 +0200 |
| 4 | Subject: [PATCH 1/2] Fix UndefinedVariableError, which had, uh, undefined |
| 5 | variables |
| 6 | |
| 7 | Signed-off-by: martin f. krafft <madduck@madduck.net> |
| 8 | --- |
| 9 | reclass/errors.py | 4 +++- |
| 10 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/reclass/errors.py b/reclass/errors.py |
| 13 | index 4da2bc3..ddb95fd 100644 |
| 14 | --- a/reclass/errors.py |
| 15 | +++ b/reclass/errors.py |
| 16 | @@ -131,9 +131,11 @@ class UndefinedVariableError(InterpolationError): |
| 17 | super(UndefinedVariableError, self).__init__(msg=None) |
| 18 | self._var = var |
| 19 | self._context = context |
| 20 | + var = property(lambda self: self._var) |
| 21 | + context = property(lambda self: self._context) |
| 22 | |
| 23 | def _get_message(self): |
| 24 | - msg = "Cannot resolve " + var.join(PARAMETER_INTERPOLATION_SENTINELS) |
| 25 | + msg = "Cannot resolve " + self._var.join(PARAMETER_INTERPOLATION_SENTINELS) |
| 26 | if self._context: |
| 27 | msg += ' in the context of %s' % self._context |
| 28 | return msg |
| 29 | -- |
| 30 | 2.1.4 |
| 31 | |