diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index b637a5fd..b638d83a 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -116,11 +116,14 @@ class _ExpEngine(object): def _eval_conditional(expression, cfg, setting): if not expression: return False, () - parsed = ast.parse(expression) - parsed = parsed.body[0].value - evaluator = _ExpEngine(cfg, setting) - result = evaluator.process(parsed) - return result, evaluator.relatedsettings + try: + parsed = ast.parse(expression) + parsed = parsed.body[0].value + evaluator = _ExpEngine(cfg, setting) + result = evaluator.process(parsed) + return result, evaluator.relatedsettings + except SyntaxError: + return False, () class LenovoFirmwareConfig(object):