diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2016-06-02 23:38:08 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2016-06-03 11:19:28 +0200 |
commit | c90a537983f025b7054b48b8be2d3752cbb3d389 (patch) | |
tree | 2750f82ffa575e7d2e2b5a2fcd85560217370763 | |
parent | fd61bb665b285a51ced803e6ab3164671054c694 (diff) |
Fix pynslcd expression representation
The problem was that the ExpressionMapping string value did not include
the quotes which will cause problems when printing the expression (e.g.
when logging or dumping config, etc.).
-rw-r--r-- | pynslcd/attmap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pynslcd/attmap.py b/pynslcd/attmap.py index b64a048..6012d39 100644 --- a/pynslcd/attmap.py +++ b/pynslcd/attmap.py @@ -77,7 +77,7 @@ class ExpressionMapping(str): def __init__(self, value): """Parse the expression as a string.""" - self.expression = Expression(value) + self.expression = Expression(value[1:-1]) super(ExpressionMapping, self).__init__(value) def values(self, variables): @@ -127,7 +127,7 @@ class Attributes(dict): def __setitem__(self, attribute, mapping): # translate the mapping into a mapping object if mapping[0] == '"' and mapping[-1] == '"': - mapping = ExpressionMapping(mapping[1:-1]) + mapping = ExpressionMapping(mapping) elif '(' in mapping: mapping = FunctionMapping(mapping) else: |