From fce60953243441eb15a4aefa273fff4affcaada7 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 10 Dec 2023 08:47:29 +0200 Subject: [PATCH] Make bin/optimize.py choke early on incomplete role definitions This provides better error messages. Related to 6bc5602607fdc721fd65eb2cb9624d3633ffe976 and 3b432c11d37c938f871d93e30428e5feac5162f5 --- bin/optimize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/optimize.py b/bin/optimize.py index 24570c0..2903d9f 100644 --- a/bin/optimize.py +++ b/bin/optimize.py @@ -146,6 +146,8 @@ all_role_definitions = load_yaml_file(args.src_requirements_yml_path) enabled_role_definitions = [] for role_definition in all_role_definitions: + if 'name' not in role_definition: + raise Exception('Role definition does not have a name and should be adjusted to have one: {0}'.format(role_definition)) if is_role_definition_in_use(role_definition, used_variable_names): enabled_role_definitions.append(role_definition)