From ae5315c32e4b45aeb689319cc7b4815380ac03cc Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Wed, 14 Aug 2019 18:17:20 +0100 Subject: [PATCH] Use the import style. --- synapse/handlers/devicemessage.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/devicemessage.py b/synapse/handlers/devicemessage.py index fb6320d359c9..d56d27711351 100644 --- a/synapse/handlers/devicemessage.py +++ b/synapse/handlers/devicemessage.py @@ -22,6 +22,7 @@ from synapse.api.errors import SynapseError from synapse.logging.opentracing import ( get_active_span_text_map, + log_kv, set_tag, start_active_span, whitelisted_homeserver, @@ -86,8 +87,8 @@ def on_direct_to_device_edu(self, origin, content): @defer.inlineCallbacks def send_device_message(self, sender_user_id, message_type, messages): - opentracing.set_tag("number_of_messages", len(messages)) - opentracing.set_tag("sender", sender_user_id) + set_tag("number_of_messages", len(messages)) + set_tag("sender", sender_user_id) local_messages = {} remote_messages = {} for user_id, by_device in messages.items(): @@ -125,7 +126,7 @@ def send_device_message(self, sender_user_id, message_type, messages): else None, } - opentracing.log_kv({"local_messages": local_messages}) + log_kv({"local_messages": local_messages}) stream_id = yield self.store.add_messages_to_device_inbox( local_messages, remote_edu_contents ) @@ -134,7 +135,7 @@ def send_device_message(self, sender_user_id, message_type, messages): "to_device_key", stream_id, users=local_messages.keys() ) - opentracing.log_kv({"remote_messages": remote_messages}) + log_kv({"remote_messages": remote_messages}) for destination in remote_messages.keys(): # Enqueue a new federation transaction to send the new # device messages to each remote destination.