From c5d8d9e88ad16831976b72b9aaed3caf0c91674c Mon Sep 17 00:00:00 2001 From: Naga Ravi Chaitanya Elluri Date: Thu, 29 Oct 2020 14:05:35 -0400 Subject: [PATCH] Display the pod scenarios logs The current implementation just reports the pass/fail when running the pod scenarios. This commit prints the pod scenarios logs to stdout to give users the ability to understand the actions run by powerfulseal under the hood - number of pods matching the filter, pods picked for killing, post checks etc. This also helps in debugging when the scenarios fail. --- .travis.yml | 2 +- run_kraken.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72e45996..1f947e4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: xenial langauge: python -python: "3.6" +python: "3.6.8" before_install: - sudo apt-get update diff --git a/run_kraken.py b/run_kraken.py index 0bc1c6fc..aed6a2b0 100644 --- a/run_kraken.py +++ b/run_kraken.py @@ -160,11 +160,14 @@ def pod_scenarios(scenarios_list, config, failed_post_scenarios): pre_action_output = run_post_action(kubeconfig_path, pod_scenario[1]) else: pre_action_output = '' - runcommand.invoke("powerfulseal autonomous --use-pod-delete-instead-of-ssh-kill" + scenario_logs = runcommand.invoke("powerfulseal autonomous --use-pod-delete-instead-of-ssh-kill" " --policy-file %s --kubeconfig %s --no-cloud" " --inventory-kubernetes --headless" % (pod_scenario[0], kubeconfig_path)) + # Display pod scenario logs/actions + print(scenario_logs) + logging.info("Scenario: %s has been successfully injected!" % (pod_scenario[0])) logging.info("Waiting for the specified duration: %s" % (wait_duration)) time.sleep(wait_duration)