Compare commits

..

No commits in common. "develop" and "main" have entirely different histories.

841 changed files with 3675 additions and 7054 deletions

View file

@ -1,15 +1,3 @@
## 0.2.0a0 (2024-12-11)
### Feat
- rename file to yaml
### Fix
- prepare ansible user data
## 0.1.0 (2024-11-06)
## 0.1.0rc1 (2024-11-06) ## 0.1.0rc1 (2024-11-06)
### Fix ### Fix

View file

@ -1,2 +1,2 @@
# rougail-user-data-file # rougail-user-data

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2024-12-11 21:26+0100\n" "POT-Creation-Date: 2024-11-01 12:12+0100\n"
"PO-Revision-Date: 2024-12-11 21:27+0100\n" "PO-Revision-Date: 2024-11-01 12:13+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -16,20 +16,20 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.5\n"
#: src/rougail/user_data_yaml/__init__.py:42 #: src/rougail/user_data_file/__init__.py:40
msgid "yaml is not set in step.user_data" msgid "file is not set in step.user_data"
msgstr "\"yaml\" n'est pas défini dans step.user_data" msgstr "\"file\" n'est pas défini dans step.user_data"
#: src/rougail/user_data_yaml/__init__.py:61 #: src/rougail/user_data_file/__init__.py:58
msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\""
msgstr "" msgstr ""
"ne peut charger \"{0}\", la valeur racine n'est pas une dictionnaire mais " "ne peut charger \"{0}\", la valeur racine n'est pas une dictionnaire mais "
"\"{1}\"" "\"{1}\""
#: src/rougail/user_data_yaml/__init__.py:74 #: src/rougail/user_data_file/__init__.py:66
msgid "yaml ({0})" msgid "file ({0})"
msgstr "fichier yaml ({0})" msgstr "fichier ({0})"
#: src/rougail/user_data_yaml/__init__.py:103 #: src/rougail/user_data_file/__init__.py:88
msgid "\"{0}\" in {1} has an unknown value" msgid "\"{0}\" in {1} has an unknown value"
msgstr "\"{0}\" dans {1} a une valeur inconnue" msgstr "\"{0}\" dans {1} a une valeur inconnue"

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-12-11 21:27+0100\n" "POT-Creation-Date: 2024-11-01 12:13+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,19 +15,19 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: src/rougail/user_data_yaml/__init__.py:42 #: src/rougail/user_data_file/__init__.py:40
msgid "yaml is not set in step.user_data" msgid "file is not set in step.user_data"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/__init__.py:61 #: src/rougail/user_data_file/__init__.py:58
msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\""
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/__init__.py:74 #: src/rougail/user_data_file/__init__.py:66
msgid "yaml ({0})" msgid "file ({0})"
msgstr "" msgstr ""
#: src/rougail/user_data_yaml/__init__.py:103 #: src/rougail/user_data_file/__init__.py:88
msgid "\"{0}\" in {1} has an unknown value" msgid "\"{0}\" in {1} has an unknown value"
msgstr "" msgstr ""

View file

@ -3,11 +3,11 @@ build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8.0,<4"] requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail.user_data_yaml" name = "rougail.user_data_file"
version = "0.2.0a0" version = "0.1.0"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "Rougail user_data yaml" description = "Rougail user_data file"
requires-python = ">=3.8" requires-python = ">=3.8"
license = {file = "LICENSE"} license = {file = "LICENSE"}
classifiers = [ classifiers = [
@ -29,12 +29,12 @@ dependencies = [
] ]
[project.urls] [project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail-user-data-yaml" Home = "https://forge.cloud.silique.fr/stove/rougail-user-data-file"
[tool.commitizen] [tool.commitizen]
name = "cz_conventional_commits" name = "cz_conventional_commits"
tag_format = "$version" tag_format = "$version"
version_scheme = "pep440" version_scheme = "pep440"
version_provider = "pep621" version_provider = "pep621"
update_changelog_on_bump = true #update_changelog_on_bump = true
changelog_merge_prerelease = true changelog_merge_prerelease = true

View file

@ -15,16 +15,15 @@ details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
from ruamel.yaml import YAML
from rougail import RougailConfig from rougail import RougailConfig
from rougail.error import ExtentionError from ruamel.yaml import YAML
from tiramisu.error import ValueOptionError, PropertiesOptionError, LeadershipError from tiramisu.error import ValueOptionError, PropertiesOptionError, LeadershipError
from .i18n import _ from .i18n import _
class RougailUserDataYaml: class RougailUserDataFile:
def __init__( def __init__(
self, self,
config, config,
@ -34,14 +33,15 @@ class RougailUserDataYaml:
if rougailconfig is None: if rougailconfig is None:
rougailconfig = RougailConfig rougailconfig = RougailConfig
user_data = rougailconfig["step.user_data"] user_data = rougailconfig["step.user_data"]
if "yaml" not in user_data: if "file" not in user_data:
user_data.append("yaml") user_data.append("file")
rougailconfig["step.user_data"] = user_data rougailconfig["step.user_data"] = user_data
user_data = rougailconfig["step.user_data"] user_data = rougailconfig["step.user_data"]
if "yaml" not in user_data: if "file" not in user_data:
raise ExtentionError(_("yaml is not set in step.user_data")) raise Exception(_("file is not set in step.user_data"))
self.rougailconfig = rougailconfig self.rougailconfig = rougailconfig
self.filenames = self.rougailconfig["yaml.filename"] self.filenames = self.rougailconfig["file.filename"]
self.yaml = YAML()
self.config = config self.config = config
self.errors = [] self.errors = []
self.warnings = [] self.warnings = []
@ -49,29 +49,29 @@ class RougailUserDataYaml:
def run( def run(
self, self,
) -> None: ) -> None:
self.yaml = YAML()
user_datas = [] user_datas = []
for filename in self.filenames: for filename in self.filenames:
file_values = self.open(filename) with open(filename) as fh_config:
file_values = self.yaml.load(fh_config)
if not file_values: if not file_values:
continue continue
values = {}
if not isinstance(file_values, dict): if not isinstance(file_values, dict):
self.errors.append( self.errors.append(
_( _(
'cannot load "{0}", the root value is not a dict but "{1}"' 'cannot load "{0}", the root value is not a dict but "{1}"'
).format(filename, file_values) ).format(filename, file_values)
) )
else: continue
self.parse( values = {}
values, self.parse(
"", values,
file_values, "",
filename, file_values,
) filename,
)
user_datas.append( user_datas.append(
{ {
"source": _("yaml ({0})").format(filename), "source": _("file ({0})").format(filename),
"errors": self.errors, "errors": self.errors,
"warnings": self.warnings, "warnings": self.warnings,
"values": values, "values": values,
@ -79,10 +79,6 @@ class RougailUserDataYaml:
) )
return user_datas return user_datas
def open(self, filename: str) -> dict:
with open(filename) as fh_config:
return self.yaml.load(fh_config)
def parse( def parse(
self, self,
values: dict, values: dict,
@ -117,7 +113,7 @@ class RougailUserDataYaml:
values[path] = value values[path] = value
RougailUserData = RougailUserDataYaml RougailUserData = RougailUserDataFile
__all__ = ("RougailUserDataYaml",) __all__ = ("RougailUserDataFile",)

View file

@ -1,5 +1,5 @@
""" """
Config yaml for Rougail-user-data Config file for Rougail-user-data
Silique (https://www.silique.fr) Silique (https://www.silique.fr)
Copyright (C) 2024 Copyright (C) 2024
@ -24,16 +24,16 @@ def get_rougail_config(
backward_compatibility=True, backward_compatibility=True,
) -> dict: ) -> dict:
options = """ options = """
yaml: file:
description: Configuration rougail-user-data-yaml description: Configuration rougail-user-data-file
disabled: disabled:
type: jinja type: jinja
jinja: | jinja: |
{% if 'yaml' not in step.user_data %} {% if 'file' not in step.user_data %}
disabled disabled
{% endif %} {% endif %}
filename: filename:
description: Filename description: Filename with user data
alternative_name: ff alternative_name: ff
type: unix_filename type: unix_filename
multi: true multi: true
@ -44,7 +44,7 @@ yaml:
- file - file
""" """
return { return {
"name": "yaml", "name": "file",
"process": "user data", "process": "user data",
"options": options, "options": options,
"level": 50, "level": 50,

View file

@ -20,7 +20,7 @@ from gettext import translation
from pathlib import Path from pathlib import Path
t = translation( t = translation(
"rougail_user_data_yaml", str(Path(__file__).parent / "locale"), fallback=True "rougail_user_data_file", str(Path(__file__).parent / "locale"), fallback=True
) )
_ = t.gettext _ = t.gettext

View file

@ -0,0 +1 @@
{}

View file

@ -1 +1 @@
{} {}

View file

@ -1 +1 @@
{} {}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { version: string1
"version": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { version: string1
"version": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { version: string1
"version": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { empty: string1
"empty": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { empty: string1
"empty": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { empty: string1
"empty": "string1"
}
}

View file

@ -1,10 +1,6 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2:
"var2": [ - string1
"string1", - string2
"string2", - string3
"string3"
]
}
}

View file

@ -1,10 +1,6 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2:
"var2": [ - string1
"string1", - string2
"string2", - string3
"string3"
]
}
}

View file

@ -1,14 +1,9 @@
{ rougail:
"rougail": { var1:
"var1": [ - string1
"string1", - string2
"string2", - string3
"string3" var2:
], - string1
"var2": [ - string2
"string1", - string3
"string2",
"string3"
]
}
}

View file

@ -1,14 +1,9 @@
{ rougail:
"rougail": { var1:
"var1": [ - string1
"string1", - string2
"string2", - string3
"string3" var2:
], - string1
"var2": [ - string2
"string1", - string3
"string2",
"string3"
]
}
}

View file

@ -1,12 +1,7 @@
{ rougail:
"rougail": { var1:
"var1": [ - domain1.lan
"domain1.lan", - domain2.lan
"domain2.lan" var2:
], - domain1.lan
"var2": [ - domain2.lan
"domain1.lan",
"domain2.lan"
]
}
}

View file

@ -1,12 +1,7 @@
{ rougail:
"rougail": { var1:
"var1": [ - domain1.lan
"domain1.lan", - domain2.lan
"domain2.lan" var2:
], - domain1.lan
"var2": [ - domain2.lan
"domain1.lan",
"domain2.lan"
]
}
}

View file

@ -1,8 +1,4 @@
{ rougail:
"rougail": { var1:
"var1": [ - domain1.lan
"domain1.lan", - domain2.lan
"domain2.lan"
]
}
}

View file

@ -1,6 +1,2 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1",
"var2": "string1"
}
}

View file

@ -1,6 +1,2 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1",
"var2": "string1"
}
}

View file

@ -1,6 +1,2 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1",
"var2": "string1"
}
}

View file

@ -1,4 +1,3 @@
{ {
"rougail.var1": "string1", "rougail.var1": "string1"
"rougail.var2": "string1"
} }

View file

@ -1,4 +1,3 @@
{ {
"rougail.var1": "string1", "rougail.var1": "string1"
"rougail.var2": "string1"
} }

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { without_type: string1
"without_type": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { without_type: string1
"without_type": "string1"
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: true
"var1": true, var2: true
"var2": true, var3: true
"var3": true, var4: true
"var4": true, var5: true
"var5": true, var6: true
"var6": true
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: true
"var1": true, var2: true
"var2": true, var3: true
"var3": true, var4: true
"var4": true, var5: true
"var5": true, var6: true
"var6": true
}
}

View file

@ -1 +1 @@
{} {}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: true
"variable": true
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: true
"variable": true
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: a
"var1": "a", var2: a
"var2": "a", var3: a
"var3": "a", var4:
"var4": null, var5: a
"var5": "a", var6: 1
"var6": 1
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: a
"var1": "a", var2: a
"var2": "a", var3: a
"var3": "a", var4:
"var4": null, var5: a
"var5": "a", var6: 1
"var6": 1
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { var1: a
"var1": "a", var2: a
"var2": "a"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: 0
"var": 0
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: 0
"var": 0
}
}

View file

@ -1,10 +1,6 @@
{ rougail:
"rougail": { var1:
"var1": [ - string1
"string1", - string2
"string2", - string3
"string3" var2: string1
],
"var2": "string1"
}
}

View file

@ -1,10 +1,6 @@
{ rougail:
"rougail": { var1:
"var1": [ - string1
"string1", - string2
"string2", - string3
"string3" var2: string1
],
"var2": "string1"
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { custom1: string1
"custom1": "string1", custom2: string1
"custom2": "string1"
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { custom1: string1
"custom1": "string1", custom2: string1
"custom2": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { custom1: string1
"custom1": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: domain1.lan
"variable": "domain1.lan"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: domain1.lan
"variable": "domain1.lan"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: domain1.lan
"variable": "domain1.lan"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: domain1.lan
"variable": "domain1.lan"
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: 1.1
"var1": 1.1, var2: 1.1
"var2": 1.1, var3: 1.1
"var3": 1.1, var4: 1.1
"var4": 1.1, var5: 1.1
"var5": 1.1, var6: 1.1
"var6": 1.1
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: 1.1
"var1": 1.1, var2: 1.1
"var2": 1.1, var3: 1.1
"var3": 1.1, var4: 1.1
"var4": 1.1, var5: 1.1
"var5": 1.1, var6: 1.1
"var6": 1.1
}
}

View file

@ -1 +1 @@
{} {}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: 1
"var1": 1, var2: 1
"var2": 1, var3: 1
"var3": 1, var4: 1
"var4": 1, var5: 1
"var5": 1, var6: 1
"var6": 1
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: 1
"var1": 1, var2: 1
"var2": 1, var3: 1
"var3": 1, var4: 1
"var4": 1, var5: 1
"var5": 1, var6: 1
"var6": 1
}
}

View file

@ -1 +1 @@
{} {}

View file

@ -1,7 +1,4 @@
{ rougail:
"rougail": { variable1: '80'
"variable1": "80", variable2: '80'
"variable2": "80", variable3: '80'
"variable3": "80"
}
}

View file

@ -1,7 +1,4 @@
{ rougail:
"rougail": { variable1: '80'
"variable1": "80", variable2: '80'
"variable2": "80", variable3: '80'
"variable3": "80"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable1: '80'
"variable1": "80"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: '#b1b1b1'
"var": "#b1b1b1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: '#b1b1b1'
"var": "#b1b1b1"
}
}

View file

@ -1 +1 @@
{} {}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1", var3: string1
"var3": "string1", var4: string1
"var4": "string1", var5: string1
"var5": "string1", var6: string1
"var6": "string1"
}
}

View file

@ -1,10 +1,7 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1", var3: string1
"var3": "string1", var4: string1
"var4": "string1", var5: string1
"var5": "string1", var6: string1
"var6": "string1"
}
}

View file

@ -1,7 +1,4 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1", var3: string1
"var3": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: quote'
"var": "quote'"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { var: quote'
"var": "quote'"
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1"
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1"
}
}

View file

@ -1,6 +1,3 @@
{ rougail:
"rougail": { var1: string1
"var1": "string1", var2: string1
"var2": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,5 +1,2 @@
{ rougail:
"rougail": { variable: string1
"variable": "string1"
}
}

View file

@ -1,13 +1,6 @@
{ rougail:
"rougail": { var1: test
"var1": "test", var2: test
"var2": "test", var3: test1
"var3": "test1", var4:
"var4": null, var5: false
"var5": false,
"var6": [
"test1",
"test2"
]
}
}

View file

@ -1,13 +1,6 @@
{ rougail:
"rougail": { var1: test
"var1": "test", var2: test
"var2": "test", var3: test1
"var3": "test1", var4:
"var4": null, var5: false
"var5": false,
"var6": [
"test1",
"test2"
]
}
}

View file

@ -1,10 +1,3 @@
{ rougail:
"rougail": { var1: test
"var1": "test", var3: test1
"var3": "test1",
"var6": [
"test1",
"test2"
]
}
}

View file

@ -3,9 +3,5 @@
"rougail.var2": "test", "rougail.var2": "test",
"rougail.var3": "test1", "rougail.var3": "test1",
"rougail.var4": null, "rougail.var4": null,
"rougail.var5": false, "rougail.var5": false
"rougail.var6": [
"test1",
"test2"
]
} }

Some files were not shown because too many files have changed in this diff Show more