From 372039a594fa54e674b6ad160113b7259dda3502 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Fri, 5 Apr 2019 17:27:06 +0300 Subject: [PATCH] Rename cli_type parameter Template type could be passed both using CLI and via API directly. This patch renames cli_type to template_type to make code less confusing. Change-Id: I6f9941c0db520bab1aa08ea3ce99e07a36d0c360 --- vitrage/evaluator/template_db/template_repository.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vitrage/evaluator/template_db/template_repository.py b/vitrage/evaluator/template_db/template_repository.py index 54d23fc0a..d03a2de24 100644 --- a/vitrage/evaluator/template_db/template_repository.py +++ b/vitrage/evaluator/template_db/template_repository.py @@ -32,11 +32,11 @@ METADATA = 'metadata' NAME = 'name' -def add_templates_to_db(db, templates, cli_type, params=None): +def add_templates_to_db(db, templates, template_type, params=None): db_rows = list() for template in templates: - final_type = template[METADATA].get(TFields.TYPE, cli_type) - if not final_type or (cli_type and cli_type != final_type): + final_type = template[METADATA].get(TFields.TYPE, template_type) + if not final_type or (template_type and template_type != final_type): db_rows.append(_get_error_result(template, final_type, "Unknown template type")) continue @@ -66,11 +66,11 @@ def add_templates_to_db(db, templates, cli_type, params=None): return db_rows -def validate_templates(db, templates, cli_type, params): +def validate_templates(db, templates, template_type, params): results = list() for template in templates: - final_type = template[METADATA].get(TFields.TYPE, cli_type) - if not final_type or (cli_type and cli_type != final_type): + final_type = template[METADATA].get(TFields.TYPE, template_type) + if not final_type or (template_type and template_type != final_type): results.append( get_content_fault_result(66, "Unknown template type")) else: