From efd345ec46b1d386878bae963725c7223800cbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 29 Aug 2018 11:24:44 +0200 Subject: [PATCH] Upgrade attachments CLI cmd: added compatibility with new 'validator' key We now support both the old coerce=markdown and the new validator=markdown. Probably support for the old can be removed, but I'm keeping it around just to be sure. --- pillar/cli/maintenance.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pillar/cli/maintenance.py b/pillar/cli/maintenance.py index 22a5fdca..461b9daa 100644 --- a/pillar/cli/maintenance.py +++ b/pillar/cli/maintenance.py @@ -767,7 +767,9 @@ def iter_markdown(proj_node_types: dict, some_node: dict, callback: typing.Calla continue to_visit.append((subdoc, definition['schema'])) continue - if definition.get('coerce') != 'markdown': + coerce = definition.get('coerce') # Eve < 0.8 + validator = definition.get('validator') # Eve >= 0.8 + if coerce != 'markdown' and validator != 'markdown': continue my_log.debug('I have to change %r of %s', key, doc)