From ed51b5449641093e4af81bcb6f17afebaa1cab6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Vonheiden?= <bjoern.vonheiden@hotmail.de> Date: Wed, 16 Sep 2020 16:27:52 +0200 Subject: [PATCH] enchance topic deletion in run uc py --- execution/run_uc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/execution/run_uc.py b/execution/run_uc.py index f25d2555e..173b8820c 100644 --- a/execution/run_uc.py +++ b/execution/run_uc.py @@ -325,11 +325,13 @@ def delete_topics(topics): """ print('Delete topics from Kafka') + topics_delete = 'theodolite-.*|' + '|'.join([ti[0] for ti in topics]) + num_topics_command = [ '/bin/sh', '-c', f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list \ - | sed -n -E "/^(theodolite-.*|input|output|configuration)\ + | sed -n -E "/^({topics_delete})\ ( - marked for deletion)?$/p" | wc -l' ] @@ -337,7 +339,7 @@ def delete_topics(topics): '/bin/sh', '-c', f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --delete \ - --topic "input|output|configuration|theodolite-.*"' + --topic "{topics_delete}"' ] # Wait that topics get deleted -- GitLab