Compare commits
No commits in common. "fa039c1743b53a3349776215f5e7529987193c00" and "b0fdef7a52291cdd6a31fab8423ef76b98b2b4c6" have entirely different histories.
fa039c1743
...
b0fdef7a52
15 changed files with 20 additions and 111 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,13 +1,3 @@
|
||||||
## 0.2.0a1 (2025-02-10)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- add new parameter yaml.file_with_secrets
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- update tests
|
|
||||||
|
|
||||||
## 0.2.0a0 (2024-12-11)
|
## 0.2.0a0 (2024-12-11)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"POT-Creation-Date: 2025-02-10 09:21+0100\n"
|
"POT-Creation-Date: 2024-12-11 21:26+0100\n"
|
||||||
"PO-Revision-Date: 2025-02-10 09:22+0100\n"
|
"PO-Revision-Date: 2024-12-11 21:27+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
|
@ -20,28 +20,16 @@ msgstr ""
|
||||||
msgid "yaml is not set in step.user_data"
|
msgid "yaml is not set in step.user_data"
|
||||||
msgstr "\"yaml\" n'est pas défini dans step.user_data"
|
msgstr "\"yaml\" n'est pas défini dans step.user_data"
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/__init__.py:62
|
#: src/rougail/user_data_yaml/__init__.py:61
|
||||||
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:85
|
#: src/rougail/user_data_yaml/__init__.py:74
|
||||||
msgid "yaml ({0})"
|
msgid "yaml ({0})"
|
||||||
msgstr "fichier yaml ({0})"
|
msgstr "fichier yaml ({0})"
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/__init__.py:116
|
#: src/rougail/user_data_yaml/__init__.py:103
|
||||||
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"
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:29
|
|
||||||
msgid "Configuration rougail-user-data-yaml"
|
|
||||||
msgstr "Configuration de rougail-user-data-yaml"
|
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:38
|
|
||||||
msgid "Filename"
|
|
||||||
msgstr "Nom du fichier"
|
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:49
|
|
||||||
msgid "File that may contain secrets"
|
|
||||||
msgstr "Le fichier peut contenir des secrets"
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2025-02-10 09:22+0100\n"
|
"POT-Creation-Date: 2024-12-11 21:27+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"
|
||||||
|
|
@ -19,27 +19,15 @@ msgstr ""
|
||||||
msgid "yaml is not set in step.user_data"
|
msgid "yaml is not set in step.user_data"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/__init__.py:62
|
#: src/rougail/user_data_yaml/__init__.py:61
|
||||||
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:85
|
#: src/rougail/user_data_yaml/__init__.py:74
|
||||||
msgid "yaml ({0})"
|
msgid "yaml ({0})"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/__init__.py:116
|
#: src/rougail/user_data_yaml/__init__.py:103
|
||||||
msgid "\"{0}\" in {1} has an unknown value"
|
msgid "\"{0}\" in {1} has an unknown value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:29
|
|
||||||
msgid "Configuration rougail-user-data-yaml"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:38
|
|
||||||
msgid "Filename"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/user_data_yaml/config.py:49
|
|
||||||
msgid "File that may contain secrets"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.user_data_yaml"
|
name = "rougail.user_data_yaml"
|
||||||
version = "0.2.0a1"
|
version = "0.2.0a0"
|
||||||
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 yaml"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU Lesser General Public License as published by the
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
|
@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
from rougail import RougailConfig
|
||||||
from rougail.error import ExtentionError
|
from rougail.error import ExtentionError
|
||||||
from tiramisu.error import ValueOptionError, PropertiesOptionError, LeadershipError
|
from tiramisu.error import ValueOptionError, PropertiesOptionError, LeadershipError
|
||||||
|
|
||||||
|
|
@ -31,7 +32,6 @@ class RougailUserDataYaml:
|
||||||
rougailconfig=None,
|
rougailconfig=None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if rougailconfig is None:
|
if rougailconfig is None:
|
||||||
from rougail import RougailConfig
|
|
||||||
rougailconfig = RougailConfig
|
rougailconfig = RougailConfig
|
||||||
user_data = rougailconfig["step.user_data"]
|
user_data = rougailconfig["step.user_data"]
|
||||||
if "yaml" not in user_data:
|
if "yaml" not in user_data:
|
||||||
|
|
@ -42,7 +42,6 @@ class RougailUserDataYaml:
|
||||||
raise ExtentionError(_("yaml is not set in step.user_data"))
|
raise ExtentionError(_("yaml is not set in step.user_data"))
|
||||||
self.rougailconfig = rougailconfig
|
self.rougailconfig = rougailconfig
|
||||||
self.filenames = self.rougailconfig["yaml.filename"]
|
self.filenames = self.rougailconfig["yaml.filename"]
|
||||||
self.file_with_secrets = self.rougailconfig["yaml.file_with_secrets"]
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.errors = []
|
self.errors = []
|
||||||
self.warnings = []
|
self.warnings = []
|
||||||
|
|
@ -52,7 +51,7 @@ class RougailUserDataYaml:
|
||||||
) -> None:
|
) -> None:
|
||||||
self.yaml = YAML()
|
self.yaml = YAML()
|
||||||
user_datas = []
|
user_datas = []
|
||||||
for idx, filename in enumerate(self.filenames):
|
for filename in self.filenames:
|
||||||
file_values = self.open(filename)
|
file_values = self.open(filename)
|
||||||
if not file_values:
|
if not file_values:
|
||||||
continue
|
continue
|
||||||
|
|
@ -70,24 +69,12 @@ class RougailUserDataYaml:
|
||||||
file_values,
|
file_values,
|
||||||
filename,
|
filename,
|
||||||
)
|
)
|
||||||
if self.file_with_secrets == 'none':
|
|
||||||
allow_secrets_variables = False
|
|
||||||
elif self.file_with_secrets == 'first':
|
|
||||||
allow_secrets_variables = idx == 0
|
|
||||||
elif self.file_with_secrets == 'last':
|
|
||||||
if not idx:
|
|
||||||
last_filenames = len(self.filenames) - 1
|
|
||||||
allow_secrets_variables = idx == last_filenames
|
|
||||||
else:
|
|
||||||
allow_secrets_variables = True
|
|
||||||
user_datas.append(
|
user_datas.append(
|
||||||
{
|
{
|
||||||
"source": _("yaml ({0})").format(filename),
|
"source": _("yaml ({0})").format(filename),
|
||||||
"errors": self.errors,
|
"errors": self.errors,
|
||||||
"warnings": self.warnings,
|
"warnings": self.warnings,
|
||||||
"values": values,
|
"values": values,
|
||||||
'options': {'allow_secrets_variables': allow_secrets_variables,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return user_datas
|
return user_datas
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
Config yaml for Rougail-user-data
|
Config yaml for Rougail-user-data
|
||||||
|
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU Lesser General Public License as published by the
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
|
@ -17,25 +17,23 @@ 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 .i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
def get_rougail_config(
|
def get_rougail_config(
|
||||||
*,
|
*,
|
||||||
backward_compatibility=True,
|
backward_compatibility=True,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
options = f"""
|
options = """
|
||||||
yaml:
|
yaml:
|
||||||
description: {_("Configuration rougail-user-data-yaml")}
|
description: Configuration rougail-user-data-yaml
|
||||||
disabled:
|
disabled:
|
||||||
type: jinja
|
type: jinja
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if 'yaml' not in step.user_data %}}
|
{% if 'yaml' not in step.user_data %}
|
||||||
disabled
|
disabled
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
|
|
||||||
filename:
|
filename:
|
||||||
description: {_("Filename")}
|
description: Filename
|
||||||
alternative_name: ff
|
alternative_name: ff
|
||||||
type: unix_filename
|
type: unix_filename
|
||||||
multi: true
|
multi: true
|
||||||
|
|
@ -44,15 +42,6 @@ yaml:
|
||||||
test_existence: True
|
test_existence: True
|
||||||
types:
|
types:
|
||||||
- file
|
- file
|
||||||
|
|
||||||
file_with_secrets:
|
|
||||||
description: {_("File that may contain secrets")}
|
|
||||||
default: all
|
|
||||||
choices:
|
|
||||||
- all
|
|
||||||
- first
|
|
||||||
- last
|
|
||||||
- none
|
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
"name": "yaml",
|
"name": "yaml",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"""Internationalisation utilities
|
"""Internationalisation utilities
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2024-2025
|
Copyright (C) 2024
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU Lesser General Public License as published by the
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"errors": [],
|
|
||||||
"warnings": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"errors": [],
|
|
||||||
"warnings": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"rougail": {
|
|
||||||
"secret1": "string1",
|
|
||||||
"secret2": "string1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"rougail": {
|
|
||||||
"secret1": "string1",
|
|
||||||
"secret2": "string1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"rougail": {
|
|
||||||
"secret1": "string1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.secret1": "string1",
|
|
||||||
"rougail.secret2": "string1"
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.secret1": "string1",
|
|
||||||
"rougail.secret2": "value"
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue