Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi Gheidi committed Feb 15, 2024
1 parent f737b86 commit 8cf5ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions kafka_server/coordinator/api/broker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import os
import sys
import random
from random import SystemRandom

COORDINATOR_PROJECT_PATH = os.getenv("COORDINATOR_PROJECT_PATH", "/app/")
sys.path.append(os.path.abspath(COORDINATOR_PROJECT_PATH))
Expand All @@ -13,6 +13,7 @@


api_blueprint = Blueprint('api', __name__)
cryptogen = SystemRandom()


@api_blueprint.route('/init', methods=['GET'])
Expand All @@ -35,7 +36,7 @@ def init_broker():
replica_url = None
if broker_id not in all_brokers_replicas:
keys = all_brokers.keys()
key = random.choice(list(keys))
key = cryptogen.choice(list(keys))
replica_url = all_brokers[key]
response_code = broker_database.add_replica_for_broker(broker_id, replica_url)
if response_code != 200:
Expand Down
2 changes: 1 addition & 1 deletion kafka_server/coordinator_database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def delete_broker():
broker_id = data['broker_id']
with concurrent.futures.ThreadPoolExecutor() as executor:
future = executor.submit(broker.delete_broker, broker_id)
result = future.result()
_ = future.result()
return jsonify("Successfully deleted")


Expand Down

0 comments on commit 8cf5ec5

Please sign in to comment.