From 0f78d04564d3d852bdd634207aab01b7cb05db88 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 18 Jun 2025 07:42:52 +0300 Subject: [PATCH] fix: rougail separation --- src/rougail/output_ansible/__init__.py | 2 +- ...lated_variable_description_multi_line.json | 44 +++++++++++++++++++ ...lated_variable_description_multi_line.json | 44 +++++++++++++++++++ ...lated_variable_description_multi_line.json | 44 +++++++++++++++++++ ...lated_variable_description_multi_line.json | 44 +++++++++++++++++++ ...lated_variable_description_multi_line.json | 24 ++++++++++ 6 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json create mode 100644 tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json create mode 100644 tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json create mode 100644 tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json create mode 100644 tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json diff --git a/src/rougail/output_ansible/__init__.py b/src/rougail/output_ansible/__init__.py index 2fd138b..07f5b2c 100644 --- a/src/rougail/output_ansible/__init__.py +++ b/src/rougail/output_ansible/__init__.py @@ -20,7 +20,7 @@ from typing import Optional from json import dumps from tiramisu import groups -from rougail.utils import normalize_family +from rougail.tiramisu import normalize_family from .i18n import _ from .__version__ import __version__ diff --git a/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..3ad50ee --- /dev/null +++ b/tests/results/test_namespace/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,44 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..3ad50ee --- /dev/null +++ b/tests/results/test_namespace_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,44 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..88f0175 --- /dev/null +++ b/tests/results/test_namespace_read_write/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,44 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "var1": null, + "var2": null, + "var3": null + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "var1": null, + "var2": null, + "var3": null + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..3ad50ee --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,44 @@ +{ + "_meta": { + "hostvars": { + "GROUP1_01": { + "ansible_host": "group1.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + }, + "GROUP2_01": { + "ansible_host": "group2.net", + "rougail": { + "var1": "string1", + "var2": "string1", + "var3": "string1" + } + } + } + }, + "all": { + "children": [ + "ungrouped", + "groups" + ] + }, + "group1": { + "hosts": [ + "GROUP1_01" + ] + }, + "group2": { + "hosts": [ + "GROUP2_01" + ] + }, + "groups": { + "children": [ + "group1", + "group2" + ] + } +} \ No newline at end of file diff --git a/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json b/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json new file mode 100644 index 0000000..ed80be2 --- /dev/null +++ b/tests/results/test_namespace_read_write_mandatory_errors/00_2default_calculated_variable_description_multi_line.json @@ -0,0 +1,24 @@ +{ + "_meta": { + "hostvars": { + "localhost": { + "_errors": [ + "The following variables are mandatory but have no value:", + " - rougail.var1 (a first variable)", + " - rougail.var2 (a second variable)", + " - rougail.var3 (a new variable)" + ] + } + } + }, + "all": { + "children": [ + "ungrouped" + ] + }, + "ungrouped": { + "hosts": [ + "localhost" + ] + } +} \ No newline at end of file