From f9f21710c3ea4c2917b2f6f58fb53c1d3c2dcf0a Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 10 Apr 2019 23:37:58 -0400 Subject: [PATCH] Adhere to code style (#397) --- bind9/datadog_checks/bind9/__init__.py | 7 ++----- bind9/datadog_checks/bind9/bind9.py | 5 ++--- bind9/setup.py | 7 ++----- bind9/tests/test_check.py | 2 +- bind9/tox.ini | 11 +---------- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/bind9/datadog_checks/bind9/__init__.py b/bind9/datadog_checks/bind9/__init__.py index 3316fa8515..2c35fd615e 100644 --- a/bind9/datadog_checks/bind9/__init__.py +++ b/bind9/datadog_checks/bind9/__init__.py @@ -2,10 +2,7 @@ # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from .bind9 import Bind9Check from .__about__ import __version__ +from .bind9 import Bind9Check -__all__ = [ - '__version__', - 'Bind9Check' -] +__all__ = ['__version__', 'Bind9Check'] diff --git a/bind9/datadog_checks/bind9/bind9.py b/bind9/datadog_checks/bind9/bind9.py index 0788d0ea19..6c36b5650f 100644 --- a/bind9/datadog_checks/bind9/bind9.py +++ b/bind9/datadog_checks/bind9/bind9.py @@ -1,8 +1,8 @@ # (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datetime import datetime import xml.etree.ElementTree as ET +from datetime import datetime import requests @@ -21,8 +21,7 @@ def check(self, instance): if not dns_url: raise ConfigurationError('The statistic channel URL must be specified in the configuration') - self.service_check(self.BIND_SERVICE_CHECK, AgentCheck.OK, - message='Connection to %s was successful' % dns_url) + self.service_check(self.BIND_SERVICE_CHECK, AgentCheck.OK, message='Connection to %s was successful' % dns_url) root = self.getStatsFromUrl(dns_url) self.collectTimeMetric(root, 'boot-time') diff --git a/bind9/setup.py b/bind9/setup.py index f269393f6d..240c53daf8 100644 --- a/bind9/setup.py +++ b/bind9/setup.py @@ -2,10 +2,11 @@ # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from setuptools import setup from codecs import open from os import path +from setuptools import setup + HERE = path.abspath(path.dirname(__file__)) # Get version info @@ -30,7 +31,6 @@ author='ashuvyas45', author_email='ashuvyas45@gmail.com', license='BSD', - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -41,12 +41,9 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.7', ], - packages=['datadog_checks.bind9'], - # Run-time dependencies install_requires=[CHECKS_BASE_REQ], - # Extra files to ship with the wheel package include_package_data=True, ) diff --git a/bind9/tests/test_check.py b/bind9/tests/test_check.py index 7298dd555d..05159a6da8 100644 --- a/bind9/tests/test_check.py +++ b/bind9/tests/test_check.py @@ -149,7 +149,7 @@ ('bind9.sockstat_TCP4Active', 69), ('bind9.sockstat_TCP6Active', 2), ('bind9.sockstat_UnixActive', 0), - ('bind9.sockstat_RawActive', 1) + ('bind9.sockstat_RawActive', 1), ) Date = ["2018-08-08T01-15-46Z", "2010-08-08T01-15-46Z"] diff --git a/bind9/tox.ini b/bind9/tox.ini index 88525c207d..5fe801d5ec 100644 --- a/bind9/tox.ini +++ b/bind9/tox.ini @@ -3,9 +3,9 @@ minversion = 2.0 basepython = py37 envlist = py{27,37}-unit - flake8 [testenv] +dd_check_style = true usedevelop = true platform = linux|darwin|win32 deps = @@ -14,12 +14,3 @@ deps = commands = pip install -r requirements.in pytest -v - -[testenv:flake8] -skip_install = true -deps = flake8 -commands = flake8 . - -[flake8] -exclude = .eggs,.tox,build -max-line-length = 120