Skip to content

Commit f49c5cf

Browse files
committed
Fix pep8 to make CI green.
Signed-off-by: George Melikov <mail@gmelikov.ru>
1 parent b735aaa commit f49c5cf

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

obsender/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353

5454
CONF = cfg.CONF
5555
CONF.register_opts(victoria_metrics_opts, constants.VICTORIA_METRICS_DOMAIN)
56-
#CONF.register_opts(dpp_events_opts, constants.DPP_EVENTS_DOMAIN)
56+
# CONF.register_opts(dpp_events_opts, constants.DPP_EVENTS_DOMAIN)

obsender/senders.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import uuid
77

88
from concurrent import futures
9-
#from dpp_client.clients import http
9+
# from dpp_client.clients import http
1010
import obsender.vm_client as vm_client
11-
from requests import exceptions as requests_exceptions
11+
# from requests import exceptions as requests_exceptions
1212
import six
1313

1414
from obsender import common
1515
from obsender import constants
1616
from obsender import decorators
17-
from obsender import exceptions
17+
# from obsender import exceptions
1818

1919

2020
DEFAULT_TIMEOUT = 10 # TODO(d.burmistrov): should be config option
@@ -198,7 +198,8 @@ def __init__(self, logger, sender):
198198
self._sender = sender
199199

200200
def process(self, msg, kwargs):
201-
_msg = "[obsender_sender=%s] %s" % (self._sender.__class__.__name__, msg)
201+
_msg = "[obsender_sender=%s] %s" % (
202+
self._sender.__class__.__name__, msg)
202203
return _msg, kwargs
203204

204205

obsender/tests/unit/vm_client/test_push.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import socket
21
from functools import partial
2+
import socket
33

44
import pytest
55

@@ -20,7 +20,8 @@ def mock_sendto(monkeypatch):
2020

2121
@pytest.fixture(autouse=True)
2222
def mock_monotonic(monkeypatch):
23-
monkeypatch.setattr('obsender.vm_client.push.monotonic', partial(next, iter([1.0, 2.0])))
23+
monkeypatch.setattr(
24+
'obsender.vm_client.push.monotonic', partial(next, iter([1.0, 2.0])))
2425

2526

2627
@pytest.fixture

obsender/vm_client/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import unicode_literals
22

3-
from re import compile, sub
3+
from re import compile
4+
from re import sub
45

56
SANITIZE_METRIC_NAME_REGEX = (
67
(compile('\\s+'), '_'),

obsender/vm_client/protocol.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def send(self, *args, **kwargs):
1010

1111

1212
class BaseUdpProto(object):
13-
"""The base class for the udp client protocol.
14-
"""
13+
"""The base class for the udp client protocol."""
1514

1615
def __init__(self, host, port):
1716
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

obsender/vm_client/push.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
from __future__ import unicode_literals
22

3-
import os
43
from itertools import starmap
4+
import os
55

66
try:
77
from time import monotonic
88
except ImportError: # pragma: no cover
99
from monotonic import monotonic
1010

11-
from .helpers import env_bool, sanitize_metric_name
12-
from .protocol import NullProto, UdpProto
11+
from .helpers import env_bool
12+
from .helpers import sanitize_metric_name
13+
from .protocol import NullProto
14+
from .protocol import UdpProto
1315

1416
ENV_VARS = {
1517
'host': (str, 'PUSH_METRICS_HOST'),
@@ -65,9 +67,7 @@ def timer(
6567

6668
def duration(self, bucket, value, **tags):
6769
# type: (str, float, ...) -> None
68-
"""
69-
Sends duration in ms (float).
70-
"""
70+
"""Sends duration in ms (float)."""
7171

7272
self.send(bucket, '{:0.6f}|ms'.format(value), **tags)
7373

@@ -113,7 +113,5 @@ def __exit__(self, exc_type, exc_val, exc_tb):
113113
self.client.duration(self.bucket, elapsed, **self.tags)
114114

115115
def set_tail(self, tail): # type: (...) -> None
116-
"""
117-
The only public method
118-
"""
116+
"""The only public method"""
119117
self.tail = tail

0 commit comments

Comments
 (0)