From aac2612907a4cc6d6028739f0728b5786d8cf010 Mon Sep 17 00:00:00 2001 From: Mateusz 'mat' Rumian Date: Tue, 15 Sep 2020 16:26:35 +0200 Subject: [PATCH] Apply lint comments --- .../opentelemetry/exporter/jaeger/__init__.py | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 9c7705324ae..7c6c34d32eb 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -80,13 +80,12 @@ logger = logging.getLogger(__name__) - OTEL_ENVS = { - 'agent_host': "OTEL_EXPORTER_JAEGER_AGENT_HOST", - 'agent_port': "OTEL_EXPORTER_JAEGER_AGENT_PORT", - 'collector_endpoint': "OTEL_EXPORTER_JAEGER_ENDPOINT", - 'username': "OTEL_EXPORTER_JAEGER_USER", - 'password': "OTEL_EXPORTER_JAEGER_PASSWORD" + "agent_host": "OTEL_EXPORTER_JAEGER_AGENT_HOST", + "agent_port": "OTEL_EXPORTER_JAEGER_AGENT_PORT", + "collector_endpoint": "OTEL_EXPORTER_JAEGER_ENDPOINT", + "username": "OTEL_EXPORTER_JAEGER_USER", + "password": "OTEL_EXPORTER_JAEGER_PASSWORD", } @@ -115,11 +114,19 @@ def __init__( password=None, ): self.service_name = service_name - self.agent_host_name = os.environ.get(OTEL_ENVS["agent_host"]) or agent_host_name - self.agent_port = int(os.environ.get(OTEL_ENVS["agent_port"])) \ - if os.environ.get(OTEL_ENVS["agent_port"]) else agent_port + self.agent_host_name = ( + os.environ.get(OTEL_ENVS["agent_host"]) or agent_host_name + ) + self.agent_port = ( + int(os.environ.get(OTEL_ENVS["agent_port"])) + if os.environ.get(OTEL_ENVS["agent_port"]) + else agent_port + ) self._agent_client = None - self.collector_endpoint = os.environ.get(OTEL_ENVS["collector_endpoint"]) or collector_endpoint + self.collector_endpoint = ( + os.environ.get(OTEL_ENVS["collector_endpoint"]) + or collector_endpoint + ) self.username = os.environ.get(OTEL_ENVS["username"]) or username self.password = os.environ.get(OTEL_ENVS["password"]) or password self._collector = None @@ -341,11 +348,11 @@ class AgentClientUDP: """ def __init__( - self, - host_name, - port, - max_packet_size=UDP_PACKET_MAX_LENGTH, - client=agent.Client, + self, + host_name, + port, + max_packet_size=UDP_PACKET_MAX_LENGTH, + client=agent.Client, ): self.address = (host_name, port) self.max_packet_size = max_packet_size