summaryrefslogtreecommitdiffstats
path: root/csit/resources/tests/make_topics.py
diff options
context:
space:
mode:
Diffstat (limited to 'csit/resources/tests/make_topics.py')
-rwxr-xr-xcsit/resources/tests/make_topics.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/csit/resources/tests/make_topics.py b/csit/resources/tests/make_topics.py
index 82b1dc39..bf6d6e34 100755
--- a/csit/resources/tests/make_topics.py
+++ b/csit/resources/tests/make_topics.py
@@ -24,18 +24,19 @@
from confluent_kafka.admin import AdminClient, NewTopic
import sys
+
def create_topic(bootstrap_servers, topic_name, num_partitions=2, replication_factor=2):
admin_client = AdminClient({'bootstrap.servers': bootstrap_servers})
# Define the topic configuration
- topic = NewTopic(topic_name, num_partitions=num_partitions, replication_factor=replication_factor)
+ new_topic = NewTopic(topic_name, num_partitions=num_partitions, replication_factor=replication_factor)
# Create the topic
- admin_client.create_topics([topic])
+ admin_client.create_topics([new_topic])
if __name__ == '__main__':
- topic_name = sys.argv[1]
- bootstrap_servers = sys.argv[2]
+ topic = sys.argv[1]
+ servers = sys.argv[2]
- create_topic(bootstrap_servers, topic_name)
+ create_topic(servers, topic)