decode task actions to prevent errors

This commit is contained in:
Robert Kaussow 2020-03-04 12:29:35 +01:00
parent d622c9e3bc
commit 1d455ab85c
3 changed files with 4 additions and 3 deletions

View File

@ -1,2 +1,2 @@
* BUGFIX
* replace removed dependency `ansible.module_utils.parsing.convert_bool`
* decode task actions to prevent errors on multiline strings

View File

@ -2,7 +2,7 @@
__author__ = "Robert Kaussow"
__project__ = "ansible-later"
__version__ = "0.3.0"
__version__ = "0.3.1"
__license__ = "MIT"
__maintainer__ = "Robert Kaussow"
__email__ = "mail@geeklabor.de"

View File

@ -42,7 +42,8 @@ def check_native_yaml(candidate, settings):
if isinstance(task[action], dict):
continue
# strip additional newlines off task[action]
if task[action].strip().split() != arguments:
task_action = bytes(task[action].strip(), "utf-8").decode("unicode_escape")
if task_action.split() != arguments:
errors.append(Error(task["__line__"], description))
return Result(candidate.path, errors)