Compare commits
No commits in common. "92df0ec569ae9ab42a538ee15c4c4ef4e16f9b72" and "f6e08b4ebf925b8270d66fac4f317e1a3b66d5b9" have entirely different histories.
92df0ec569
...
f6e08b4ebf
19 changed files with 107 additions and 139 deletions
|
|
@ -1,9 +1,3 @@
|
||||||
## 0.2.0a44 (2026-05-04)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- multi layers
|
|
||||||
|
|
||||||
## 0.2.0a43 (2026-03-26)
|
## 0.2.0a43 (2026-03-26)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.cli"
|
name = "rougail.cli"
|
||||||
version = "0.2.0a44"
|
version = "0.2.0a43"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "CLI for Rougail"
|
description = "CLI for Rougail"
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ def _main(arguments, do_not_print):
|
||||||
def load_cmd_user_data(rougailconfig, arguments):
|
def load_cmd_user_data(rougailconfig, arguments):
|
||||||
rougailconfig.generate_config()
|
rougailconfig.generate_config()
|
||||||
cmd_config = rougailconfig.config
|
cmd_config = rougailconfig.config
|
||||||
cmd_config.information.set("description_type", "path_and_description")
|
|
||||||
origin_prop = cmd_config.property.default("read_write", "append")
|
origin_prop = cmd_config.property.default("read_write", "append")
|
||||||
cmd_config.property.setdefault(
|
cmd_config.property.setdefault(
|
||||||
frozenset(origin_prop | {"not_for_commandline"}), "read_write", "append"
|
frozenset(origin_prop | {"not_for_commandline"}), "read_write", "append"
|
||||||
|
|
@ -112,7 +111,7 @@ def load_cmd_user_data(rougailconfig, arguments):
|
||||||
if isinstance(warning, dict):
|
if isinstance(warning, dict):
|
||||||
for w, var in warning.items():
|
for w, var in warning.items():
|
||||||
if var:
|
if var:
|
||||||
warn(UserWarning(_('unable to load {0}, {1}').format(var.option.impl_get_display_name(var, with_quote=True), w)))
|
warn(UserWarning(f'unable to load "{var.option.impl_get_display_name(var)}", {str(w)}'))
|
||||||
else:
|
else:
|
||||||
warn(w)
|
warn(w)
|
||||||
else:
|
else:
|
||||||
|
|
@ -178,25 +177,27 @@ def manage_warnings(warnings):
|
||||||
|
|
||||||
|
|
||||||
def load_user_data(rougailconfig):
|
def load_user_data(rougailconfig):
|
||||||
layer_datas = []
|
layer_datas = {}
|
||||||
if not rougailconfig["cli.load_config"]:
|
if not rougailconfig["cli.load_config"]:
|
||||||
return None, None, None, {"errors": [], "warnings": []}
|
return None, None, None, {"errors": [], "warnings": []}
|
||||||
try:
|
try:
|
||||||
user_data_names = rougailconfig["step.user_data"]
|
user_data_names = rougailconfig["step.user_data"]
|
||||||
except PropertiesOptionError:
|
except PropertiesOptionError:
|
||||||
user_data_names = []
|
user_data_names = []
|
||||||
|
has_layers = rougailconfig["cli.layers"]
|
||||||
|
if has_layers:
|
||||||
|
layers = [[ud] for ud in user_data_names]
|
||||||
|
last_layers = len(layers) - 1
|
||||||
|
else:
|
||||||
|
layers = [user_data_names]
|
||||||
|
last_layers = 0
|
||||||
if rougailconfig["tiramisu_cache"]:
|
if rougailconfig["tiramisu_cache"]:
|
||||||
load_from_tiramisu_cache = rougailconfig["cli.load_from_tiramisu_cache"]
|
load_from_tiramisu_cache = rougailconfig["cli.load_from_tiramisu_cache"]
|
||||||
else:
|
else:
|
||||||
load_from_tiramisu_cache = False
|
load_from_tiramisu_cache = False
|
||||||
rougail = Rougail(rougailconfig, load_from_tiramisu_cache=load_from_tiramisu_cache)
|
rougail = Rougail(rougailconfig, load_from_tiramisu_cache=load_from_tiramisu_cache)
|
||||||
has_layers = rougailconfig["cli.layers"]
|
layer_name = "_".join(layers[-1])
|
||||||
last_layers = len(user_data_names) - 1
|
subconfig = rougail.run(name=layer_name)
|
||||||
if has_layers and user_data_names:
|
|
||||||
layer_name = user_data_names[-1]
|
|
||||||
else:
|
|
||||||
layer_name = None
|
|
||||||
subconfig = metaconfig = rougail.run(name=layer_name)
|
|
||||||
try:
|
try:
|
||||||
read_write = set()
|
read_write = set()
|
||||||
read_only = set()
|
read_only = set()
|
||||||
|
|
@ -209,28 +210,46 @@ def load_user_data(rougailconfig):
|
||||||
read_only |= modes
|
read_only |= modes
|
||||||
read_write |= modes
|
read_write |= modes
|
||||||
if read_write:
|
if read_write:
|
||||||
metaconfig.property.setdefault(
|
subconfig.property.setdefault(
|
||||||
frozenset(metaconfig.property.default("read_write", "append") | read_write), "read_write", "append"
|
frozenset(subconfig.property.default("read_write", "append") | read_write), "read_write", "append"
|
||||||
)
|
)
|
||||||
metaconfig.property.setdefault(
|
subconfig.property.setdefault(
|
||||||
frozenset(metaconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
|
frozenset(subconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
|
||||||
)
|
)
|
||||||
for p in read_write:
|
for p in read_write:
|
||||||
metaconfig.permissive.add(p)
|
subconfig.permissive.add(p)
|
||||||
if read_only:
|
if read_only:
|
||||||
metaconfig.property.setdefault(
|
subconfig.property.setdefault(
|
||||||
frozenset(metaconfig.property.default("read_only", "append") | read_only), "read_only", "append"
|
frozenset(subconfig.property.default("read_only", "append") | read_only), "read_only", "append"
|
||||||
)
|
)
|
||||||
for p in read_only:
|
for p in read_only:
|
||||||
metaconfig.permissive.add(p)
|
subconfig.permissive.add(p)
|
||||||
if read_write or read_only:
|
if read_write or read_only:
|
||||||
metaconfig.property.read_write()
|
subconfig.property.read_write()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
metaconfig.information.set("description_type", rougailconfig["cli.description_type"])
|
subconfig.information.set("description_type", rougailconfig["cli.description_type"])
|
||||||
rougail_user_datas = {}
|
metaconfig = subconfig
|
||||||
interactive_user_datas = {}
|
if last_layers:
|
||||||
for ud_idx, user_data_name in enumerate(reversed(user_data_names)):
|
for layer in reversed(layers[:-1]):
|
||||||
|
layer_name = "_".join(layer)
|
||||||
|
metaconfig = MetaConfig([metaconfig], name=layer_name)
|
||||||
|
metaconfig.owner.set(metaconfig.path())
|
||||||
|
subconfig = metaconfig
|
||||||
|
err_warn = {"errors": [], "warnings": []}
|
||||||
|
invalid_user_data_error = rougailconfig["cli.invalid_user_data_error"]
|
||||||
|
unknown_user_data_error = rougailconfig["cli.unknown_user_data_error"]
|
||||||
|
interactive_user_data = {}
|
||||||
|
for idx, layer in enumerate(layers):
|
||||||
|
if idx:
|
||||||
|
subconfig = subconfig.config("_".join(layer))
|
||||||
|
subconfig.owner.set(subconfig.path())
|
||||||
|
layer_name = subconfig.path()
|
||||||
|
# data user
|
||||||
|
user_data = []
|
||||||
|
if has_layers:
|
||||||
|
layer_datas[layer_name] = {}
|
||||||
|
for user_data_name in layer:
|
||||||
path = (
|
path = (
|
||||||
Path(__file__).parent.parent
|
Path(__file__).parent.parent
|
||||||
/ ("user_data_" + user_data_name)
|
/ ("user_data_" + user_data_name)
|
||||||
|
|
@ -242,79 +261,36 @@ def load_user_data(rougailconfig):
|
||||||
)
|
)
|
||||||
module = load_modules("rougail.user_data_" + user_data_name, str(path))
|
module = load_modules("rougail.user_data_" + user_data_name, str(path))
|
||||||
rougail_user_data = module.RougailUserData
|
rougail_user_data = module.RougailUserData
|
||||||
has_several_layers = hasattr(rougail_user_data, 'has_several_layers') and rougail_user_data.has_several_layers
|
if hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data:
|
||||||
if has_layers and has_several_layers:
|
interactive_user_data.setdefault(layer_name, {})[user_data_name] = rougail_user_data
|
||||||
layers_len = rougail_user_data(None, rougailconfig=rougailconfig).count_layers()
|
continue
|
||||||
else:
|
elif interactive_user_data:
|
||||||
layers_len = 1
|
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_data), user_data_name))
|
||||||
for idx in range(layers_len):
|
for ud in rougail_user_data(
|
||||||
if ud_idx and has_layers:
|
|
||||||
metaconfig = MetaConfig([metaconfig], name=user_data_name)
|
|
||||||
if not idx:
|
|
||||||
has_interactive_user_data = hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data
|
|
||||||
if has_interactive_user_data:
|
|
||||||
interactive_user_datas[user_data_name] = rougail_user_data
|
|
||||||
else:
|
|
||||||
if interactive_user_datas:
|
|
||||||
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_datas), user_data_name))
|
|
||||||
rougail_user_datas[user_data_name] = rougail_user_data
|
|
||||||
root_metaconfig = metaconfig
|
|
||||||
err_warn = {"errors": [], "warnings": []}
|
|
||||||
invalid_user_data_error = rougailconfig["cli.invalid_user_data_error"]
|
|
||||||
unknown_user_data_error = rougailconfig["cli.unknown_user_data_error"]
|
|
||||||
user_datas = []
|
|
||||||
for idx, user_data_name in enumerate(reversed(rougail_user_datas)):
|
|
||||||
rougail_user_data = rougail_user_datas[user_data_name]
|
|
||||||
if has_layers and idx:
|
|
||||||
metaconfig = metaconfig.config(user_data_name)
|
|
||||||
metaconfig.owner.set(metaconfig.path())
|
|
||||||
for ud_idx, user_data in enumerate(rougail_user_data(
|
|
||||||
subconfig,
|
subconfig,
|
||||||
rougailconfig=rougailconfig,
|
rougailconfig=rougailconfig,
|
||||||
).run()):
|
).run():
|
||||||
if has_layers and ud_idx:
|
|
||||||
metaconfig = metaconfig.config(user_data_name)
|
|
||||||
metaconfig.owner.set(metaconfig.path())
|
|
||||||
if has_layers:
|
if has_layers:
|
||||||
layer_datas.append(user_data["source"])
|
layer_datas[layer_name].setdefault(user_data_name, []).append(ud["source"])
|
||||||
new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
user_data.append(ud)
|
||||||
|
if user_data:
|
||||||
|
new_err_warn = UserData(subconfig).user_data(user_data, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||||
for level, datas in new_err_warn.items():
|
for level, datas in new_err_warn.items():
|
||||||
if datas:
|
if datas:
|
||||||
err_warn[level].extend(datas)
|
err_warn[level].extend(datas)
|
||||||
else:
|
for layer_name, interactive_user_data in interactive_user_data.items():
|
||||||
user_datas.append(user_data)
|
for layer, rougail_user_data in interactive_user_data.items():
|
||||||
if user_datas and not has_layers:
|
if has_layers and len(layers) > 1:
|
||||||
new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
subconfig = subconfig.config("_".join(layer))
|
||||||
for level, datas in new_err_warn.items():
|
subconfig.owner.set(subconfig.path())
|
||||||
if datas:
|
for user_data in rougail_user_data(
|
||||||
err_warn[level].extend(datas)
|
|
||||||
user_datas = []
|
|
||||||
for idx, user_data_name in enumerate(reversed(interactive_user_datas)):
|
|
||||||
rougail_user_data = interactive_user_datas[user_data_name]
|
|
||||||
if has_layers and idx:
|
|
||||||
metaconfig = metaconfig.config(user_data_name)
|
|
||||||
metaconfig.owner.set(metaconfig.path())
|
|
||||||
for ud_idx, user_data in enumerate(rougail_user_data(
|
|
||||||
subconfig,
|
subconfig,
|
||||||
rougailconfig=rougailconfig,
|
rougailconfig=rougailconfig,
|
||||||
).run()):
|
).run():
|
||||||
if has_layers and ud_idx:
|
|
||||||
metaconfig = metaconfig.config(user_data_name)
|
|
||||||
metaconfig.owner.set(metaconfig.path())
|
|
||||||
if has_layers:
|
if has_layers:
|
||||||
layer_datas.append(user_data["source"])
|
layer_datas[layer_name].setdefault(user_data_name, []).append(user_data["source"])
|
||||||
new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
|
||||||
for level, datas in new_err_warn.items():
|
return layer_datas, metaconfig, subconfig, err_warn
|
||||||
if datas:
|
|
||||||
err_warn[level].extend(datas)
|
|
||||||
else:
|
|
||||||
user_datas.append(user_data)
|
|
||||||
if user_datas and not has_layers:
|
|
||||||
new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
|
||||||
for level, datas in new_err_warn.items():
|
|
||||||
if datas:
|
|
||||||
err_warn[level].extend(datas)
|
|
||||||
return layer_datas, root_metaconfig, subconfig, err_warn
|
|
||||||
|
|
||||||
|
|
||||||
def get_output(rougailconfig, metaconfig, config, err_warn, layer_datas):
|
def get_output(rougailconfig, metaconfig, config, err_warn, layer_datas):
|
||||||
|
|
@ -352,5 +328,6 @@ def main(arguments=None, do_not_print=False):
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if print_traceback:
|
if print_traceback:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
exit(_("ERROR: {0}").format(err))
|
exit(_("ERROR: {0}").format(err))
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.2.0a44"
|
__version__ = "0.2.0a43"
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,11 @@
|
||||||
│ Variable [32mModified value[0m │
|
│ Variable [32mModified value[0m │
|
||||||
│ (⏳ Original default value) │
|
│ (⏳ Original default value) │
|
||||||
╰──────────────────────────────────────╯
|
╰──────────────────────────────────────╯
|
||||||
╭───────────── Layers ─────────────╮
|
╭─────────── Layers ────────────╮
|
||||||
│ • environment variable │
|
│ environment variable │
|
||||||
│ • the YAML file "yaml/file.yml" │
|
│ the YAML file "yaml/file.yml" │
|
||||||
│ • the YAML file "yaml/file2.yml" │
|
│ Bitwarden │
|
||||||
│ • Bitwarden │
|
╰───────────────────────────────╯
|
||||||
╰──────────────────────────────────╯
|
|
||||||
Variables:
|
Variables:
|
||||||
[94m┗━━ [0m📓 a description: [32ma second yaml value[0m ◀ loaded from the YAML file
|
[94m┗━━ [0m📓 a description: [32ma yaml value[0m ◀ loaded from the YAML file "yaml/file.yml"
|
||||||
[94m [0m"yaml/file2.yml" (⏳ a yaml value ◀ loaded from the YAML file
|
[94m [0m(⏳ my env value ◀ loaded from environment variable ⏳ my_value)
|
||||||
[94m [0m"yaml/file.yml" ⏳ my env value ◀ loaded from environment variable ⏳
|
|
||||||
[94m [0mmy_value)
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
my_variable: a second yaml value
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n"
|
"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"
|
||||||
|
|
@ -1 +1 @@
|
||||||
"[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| **my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | A description. +\n**Default**: my_value \n|===="
|
"[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| **my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | A description. +\n**Default**: my_value \n|====\n\n"
|
||||||
|
|
@ -1 +1 @@
|
||||||
["unable to load \"s\" (Main namespace name), it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""]
|
["unable to load \"Main namespace name\", it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""]
|
||||||
|
|
@ -1 +1 @@
|
||||||
["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings.yml\""]
|
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings.yml\""]
|
||||||
|
|
@ -3,5 +3,5 @@ main_structural_directories:
|
||||||
- structures
|
- structures
|
||||||
doc:
|
doc:
|
||||||
output_format: console
|
output_format: console
|
||||||
bitwarden:
|
json:
|
||||||
mock_enable: true
|
mandatory: true
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ main_structural_directories:
|
||||||
- structures
|
- structures
|
||||||
doc:
|
doc:
|
||||||
output_format: console
|
output_format: console
|
||||||
bitwarden:
|
json:
|
||||||
mock_enable: true
|
mandatory: true
|
||||||
cli:
|
cli:
|
||||||
warnings: false
|
warnings: false
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings3.yml\""]
|
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings3.yml\""]
|
||||||
|
|
@ -4,5 +4,5 @@ main_structural_directories:
|
||||||
- structures_warnings
|
- structures_warnings
|
||||||
doc:
|
doc:
|
||||||
output_format: console
|
output_format: console
|
||||||
bitwarden:
|
json:
|
||||||
mock_enable: true
|
mandatory: true
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,7 @@ main_structural_directories:
|
||||||
- structures_warnings
|
- structures_warnings
|
||||||
doc:
|
doc:
|
||||||
output_format: console
|
output_format: console
|
||||||
|
json:
|
||||||
|
mandatory: true
|
||||||
cli:
|
cli:
|
||||||
warnings: false
|
warnings: false
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||||
|
|
@ -1 +1 @@
|
||||||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||||
|
|
@ -1 +1 @@
|
||||||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||||
|
|
@ -25,7 +25,7 @@ def test_cli():
|
||||||
|
|
||||||
def test_cli_boolean():
|
def test_cli_boolean():
|
||||||
with chdir(test_dir / 'cli'):
|
with chdir(test_dir / 'cli'):
|
||||||
ret = main(['--main_structural_directories', 'structures', '--cli.warnings'], do_not_print=True)
|
ret = main(['--main_structural_directories', 'structures', '--display.mandatory'], do_not_print=True)
|
||||||
filename = Path('result.txt')
|
filename = Path('result.txt')
|
||||||
if not filename.is_file():
|
if not filename.is_file():
|
||||||
with filename.open('w') as fh:
|
with filename.open('w') as fh:
|
||||||
|
|
@ -37,7 +37,7 @@ def test_cli_boolean():
|
||||||
|
|
||||||
def test_cli_boolean_no():
|
def test_cli_boolean_no():
|
||||||
with chdir(test_dir / 'cli'):
|
with chdir(test_dir / 'cli'):
|
||||||
ret = main(['--main_structural_directories', 'structures', '--cli.no-warnings'], do_not_print=True)
|
ret = main(['--main_structural_directories', 'structures', '--display.no-mandatory'], do_not_print=True)
|
||||||
filename = Path('result.txt')
|
filename = Path('result.txt')
|
||||||
if not filename.is_file():
|
if not filename.is_file():
|
||||||
with filename.open('w') as fh:
|
with filename.open('w') as fh:
|
||||||
|
|
@ -116,7 +116,7 @@ def test_cli_user_datas_user_datas_layers():
|
||||||
save = os.environ.copy()
|
save = os.environ.copy()
|
||||||
os.environ["ROUGAIL_MY_VARIABLE"] = "my env value"
|
os.environ["ROUGAIL_MY_VARIABLE"] = "my env value"
|
||||||
with chdir(test_dir / 'cli'):
|
with chdir(test_dir / 'cli'):
|
||||||
ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', 'yaml/file2.yml', '--bitwarden.mock_enable'], do_not_print=True)
|
ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', '--bitwarden.mock_enable'], do_not_print=True)
|
||||||
filename = Path('result_user_datas_layers.txt')
|
filename = Path('result_user_datas_layers.txt')
|
||||||
if not filename.is_file():
|
if not filename.is_file():
|
||||||
with filename.open('w') as fh:
|
with filename.open('w') as fh:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue