From bf95674c5fd559348878f6b732ba8a592123df46 Mon Sep 17 00:00:00 2001 From: "Gael Chamoulaud (Strider)" Date: Tue, 6 Jul 2021 15:03:09 +0200 Subject: [PATCH] Fix history list sub command when not using the default log dir The 'history list' sub command is always getting the log files from the default directory ('~/validations') even if the user decided to write them in one other directory. $ validation run --validation 512e \ --validation-log-dir /var/log/validations \ --inventory /etc/ansible/hosts $ validation -vvv --debug history list \ --validation-log-dir /var/log/validations ... FileNotFoundError: [Errno 2] No such file or directory: '/home/validations/validations' This patch fixes this wrong behavior by passing the --validation-log-dir argument value to the show_history actions. Moreover, the ValidationActions class is taken validation_path and group as parameters. Passing --validation-log-dir argument value is wrong and useless. Change-Id: I9962d449ee507ee64d0c884199d02cd9ce786c9b Signed-off-by: Gael Chamoulaud (Strider) --- validations_libs/cli/history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validations_libs/cli/history.py b/validations_libs/cli/history.py index f2f66791..dba9ebe5 100644 --- a/validations_libs/cli/history.py +++ b/validations_libs/cli/history.py @@ -62,10 +62,11 @@ class ListHistory(BaseLister): "{} last validations.").format( parsed_args.history_limit)) - actions = ValidationActions(parsed_args.validation_log_dir) + actions = ValidationActions() return actions.show_history( validation_ids=parsed_args.validation, + log_path=parsed_args.validation_log_dir, history_limit=parsed_args.history_limit)