Skip to content

Commit

Permalink
Black
Browse files Browse the repository at this point in the history
  • Loading branch information
congwang09 committed Jan 13, 2025
1 parent 2623152 commit 039037e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion sdx_controller/handlers/connection_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ def _send_breakdown_to_lc(self, breakdown, operation, connection_request):
f"Doing '{operation}' operation for '{link}' with exchange_name: {exchange_name}, "
f"routing_key: {domain_name}"
)
mq_link = {"operation": operation, "service_id": connection_request.get("id"), "link": link}
mq_link = {
"operation": operation,
"service_id": connection_request.get("id"),
"link": link,
}
producer = TopicQueueProducer(
timeout=5, exchange_name=exchange_name, routing_key=domain_name
)
Expand Down
8 changes: 5 additions & 3 deletions sdx_controller/handlers/lc_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ def process_lc_json_msg(

if not service_id:
return

connection = self.db_instance.read_from_db("connections", service_id)

if not connection:
return

connection_json = json.loads(connection[service_id])
connection_json["oxp_response_code"] = msg_json.get("oxp_response_code")
connection_json["oxp_response"] = msg_json.get("oxp_response")
self.db_instance.add_key_value_pair_to_db("connections", service_id, json.dumps(connection_json))
self.db_instance.add_key_value_pair_to_db(
"connections", service_id, json.dumps(connection_json)
)
logger.info("Connection updated: " + service_id)
print(self.db_instance.read_from_db("connections", service_id))
return
Expand Down

0 comments on commit 039037e

Please sign in to comment.