diff --git a/active_directory/datadog_checks/active_directory/active_directory.py b/active_directory/datadog_checks/active_directory/active_directory.py index 5213b314a5269..5a5f38a21ef6f 100644 --- a/active_directory/datadog_checks/active_directory/active_directory.py +++ b/active_directory/datadog_checks/active_directory/active_directory.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2013-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) -from datadog_checks.checks.win import PDHBaseCheck +from datadog_checks.base.checks.win import PDHBaseCheck DEFAULT_COUNTERS = [ # counterset, instance of counter, counter name, metric name diff --git a/activemq_xml/datadog_checks/activemq_xml/activemq_xml.py b/activemq_xml/datadog_checks/activemq_xml/activemq_xml.py index 5b843457f4205..39d64351bec68 100644 --- a/activemq_xml/datadog_checks/activemq_xml/activemq_xml.py +++ b/activemq_xml/datadog_checks/activemq_xml/activemq_xml.py @@ -6,8 +6,8 @@ import requests from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative QUEUE_URL = "/admin/xml/queues.jsp" TOPIC_URL = "/admin/xml/topics.jsp" diff --git a/activemq_xml/tests/common.py b/activemq_xml/tests/common.py index 7ce7e39ebab2b..07f7c059ad2d8 100644 --- a/activemq_xml/tests/common.py +++ b/activemq_xml/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname CHECK_NAME = 'activemq_xml' diff --git a/ambari/tests/test_ambari.py b/ambari/tests/test_ambari.py index cb8d430321cbf..30809d4940454 100644 --- a/ambari/tests/test_ambari.py +++ b/ambari/tests/test_ambari.py @@ -4,8 +4,8 @@ from mock import MagicMock from datadog_checks.ambari import AmbariCheck +from datadog_checks.base import AgentCheck from datadog_checks.base.errors import CheckException -from datadog_checks.checks import AgentCheck from . import responses diff --git a/btrfs/datadog_checks/btrfs/btrfs.py b/btrfs/datadog_checks/btrfs/btrfs.py index ca22abdeb5120..8d93fa774e38c 100644 --- a/btrfs/datadog_checks/btrfs/btrfs.py +++ b/btrfs/datadog_checks/btrfs/btrfs.py @@ -14,7 +14,7 @@ from six import iteritems from six.moves import range -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck MIXED = "mixed" DATA = "data" diff --git a/cacti/datadog_checks/cacti/cacti.py b/cacti/datadog_checks/cacti/cacti.py index 9624531b9d137..725103b9c6f57 100644 --- a/cacti/datadog_checks/cacti/cacti.py +++ b/cacti/datadog_checks/cacti/cacti.py @@ -10,7 +10,7 @@ import pymysql -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck try: import rrdtool diff --git a/cassandra_nodetool/datadog_checks/cassandra_nodetool/cassandra_nodetool.py b/cassandra_nodetool/datadog_checks/cassandra_nodetool/cassandra_nodetool.py index 464a7cd72e3f0..f5df9698e9b6d 100644 --- a/cassandra_nodetool/datadog_checks/cassandra_nodetool/cassandra_nodetool.py +++ b/cassandra_nodetool/datadog_checks/cassandra_nodetool/cassandra_nodetool.py @@ -7,8 +7,8 @@ import re from collections import defaultdict -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base import AgentCheck +from datadog_checks.base.utils.subprocess_output import get_subprocess_output EVENT_TYPE = SOURCE_TYPE_NAME = 'cassandra_nodetool' DEFAULT_HOST = 'localhost' diff --git a/ceph/datadog_checks/ceph/ceph.py b/ceph/datadog_checks/ceph/ceph.py index 1255448bb3f3b..7eeb7acfd78a2 100644 --- a/ceph/datadog_checks/ceph/ceph.py +++ b/ceph/datadog_checks/ceph/ceph.py @@ -9,9 +9,9 @@ import simplejson as json from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative +from datadog_checks.base.utils.subprocess_output import get_subprocess_output class Ceph(AgentCheck): diff --git a/cilium/tests/conftest.py b/cilium/tests/conftest.py index e6667acb1d5aa..1a3eff2ce57cf 100644 --- a/cilium/tests/conftest.py +++ b/cilium/tests/conftest.py @@ -6,9 +6,9 @@ import mock import pytest +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev.kube_port_forward import port_forward from datadog_checks.dev.terraform import terraform_run -from datadog_checks.utils.common import get_docker_hostname from .common import ADDL_AGENT_METRICS, AGENT_DEFAULT_METRICS, OPERATOR_AWS_METRICS, OPERATOR_METRICS diff --git a/cisco_aci/datadog_checks/cisco_aci/cisco.py b/cisco_aci/datadog_checks/cisco_aci/cisco.py index 24d79461d13f5..711ff0f23444c 100644 --- a/cisco_aci/datadog_checks/cisco_aci/cisco.py +++ b/cisco_aci/datadog_checks/cisco_aci/cisco.py @@ -6,9 +6,9 @@ from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative -from datadog_checks.utils.containers import hash_mutable +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative +from datadog_checks.base.utils.containers import hash_mutable from . import aci_metrics from .api import Api diff --git a/cisco_aci/datadog_checks/cisco_aci/tags.py b/cisco_aci/datadog_checks/cisco_aci/tags.py index 579011c115cee..2696c960f23ce 100644 --- a/cisco_aci/datadog_checks/cisco_aci/tags.py +++ b/cisco_aci/datadog_checks/cisco_aci/tags.py @@ -6,7 +6,7 @@ from six import iteritems -from datadog_checks.utils.containers import hash_mutable +from datadog_checks.base.utils.containers import hash_mutable from . import exceptions, helpers diff --git a/cisco_aci/tests/test_capacity.py b/cisco_aci/tests/test_capacity.py index 2a334e0992859..4d496d3e1a4ac 100644 --- a/cisco_aci/tests/test_capacity.py +++ b/cisco_aci/tests/test_capacity.py @@ -2,10 +2,10 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.cisco_aci import CiscoACICheck from datadog_checks.cisco_aci.api import Api from datadog_checks.cisco_aci.capacity import Capacity -from datadog_checks.utils.containers import hash_mutable from . import common diff --git a/cisco_aci/tests/test_cisco.py b/cisco_aci/tests/test_cisco.py index e3ecc2af348c9..5d2f03c625acb 100644 --- a/cisco_aci/tests/test_cisco.py +++ b/cisco_aci/tests/test_cisco.py @@ -7,9 +7,9 @@ import pytest from mock import MagicMock +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.cisco_aci import CiscoACICheck from datadog_checks.cisco_aci.api import Api, SessionWrapper -from datadog_checks.utils.containers import hash_mutable from . import common diff --git a/cisco_aci/tests/test_fabric.py b/cisco_aci/tests/test_fabric.py index bef9193fd0106..5fb595df8733a 100644 --- a/cisco_aci/tests/test_fabric.py +++ b/cisco_aci/tests/test_fabric.py @@ -2,9 +2,9 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.cisco_aci import CiscoACICheck from datadog_checks.cisco_aci.api import Api -from datadog_checks.utils.containers import hash_mutable from . import common diff --git a/cisco_aci/tests/test_tags.py b/cisco_aci/tests/test_tags.py index 645a1578794fa..4557eca5edc2f 100644 --- a/cisco_aci/tests/test_tags.py +++ b/cisco_aci/tests/test_tags.py @@ -6,8 +6,8 @@ import pytest +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.cisco_aci.tags import CiscoTags -from datadog_checks.utils.containers import hash_mutable log = logging.getLogger('test_cisco_aci') diff --git a/cisco_aci/tests/test_tenant.py b/cisco_aci/tests/test_tenant.py index 35f25f8aa7f4c..fc869db46fbbe 100644 --- a/cisco_aci/tests/test_tenant.py +++ b/cisco_aci/tests/test_tenant.py @@ -2,10 +2,10 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.cisco_aci import CiscoACICheck from datadog_checks.cisco_aci.api import Api from datadog_checks.cisco_aci.tenant import Tenant -from datadog_checks.utils.containers import hash_mutable from . import common diff --git a/cockroachdb/datadog_checks/cockroachdb/cockroachdb.py b/cockroachdb/datadog_checks/cockroachdb/cockroachdb.py index 3efb69f2a009c..591253c806f1d 100644 --- a/cockroachdb/datadog_checks/cockroachdb/cockroachdb.py +++ b/cockroachdb/datadog_checks/cockroachdb/cockroachdb.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck from .metrics import METRIC_MAP diff --git a/coredns/tests/conftest.py b/coredns/tests/conftest.py index 8839f7ab9b9fe..c3dd9c3cf2bb4 100644 --- a/coredns/tests/conftest.py +++ b/coredns/tests/conftest.py @@ -8,9 +8,9 @@ import pytest import requests +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev import WaitFor, docker_run from datadog_checks.dev.utils import ON_WINDOWS -from datadog_checks.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) CONFIG_FOLDER = os.path.join(HERE, 'docker', 'coredns') diff --git a/couch/datadog_checks/couch/couch.py b/couch/datadog_checks/couch/couch.py index 5705c95135be0..a9e4a8a5cf287 100644 --- a/couch/datadog_checks/couch/couch.py +++ b/couch/datadog_checks/couch/couch.py @@ -10,9 +10,9 @@ from six import iteritems from six.moves.urllib.parse import quote, urljoin -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck +from datadog_checks.base.utils.headers import headers from datadog_checks.couch import errors -from datadog_checks.utils.headers import headers class CouchDb(AgentCheck): diff --git a/couch/tests/common.py b/couch/tests/common.py index 73fc653c40375..6c33a4796c1f3 100644 --- a/couch/tests/common.py +++ b/couch/tests/common.py @@ -5,7 +5,7 @@ import os import re -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname CHECK_NAME = "couch" CHECK_ID = 'test:123' diff --git a/couchbase/datadog_checks/couchbase/couchbase.py b/couchbase/datadog_checks/couchbase/couchbase.py index 5913cac8c9dc0..0ae0599224aec 100644 --- a/couchbase/datadog_checks/couchbase/couchbase.py +++ b/couchbase/datadog_checks/couchbase/couchbase.py @@ -12,7 +12,8 @@ import requests from six import string_types -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck +from datadog_checks.base.utils.containers import hash_mutable from datadog_checks.couchbase.couchbase_consts import ( BUCKET_STATS, COUCHBASE_STATS_PATH, @@ -27,7 +28,6 @@ SOURCE_TYPE_NAME, TO_SECONDS, ) -from datadog_checks.utils.containers import hash_mutable class Couchbase(AgentCheck): diff --git a/couchbase/datadog_checks/couchbase/couchbase_consts.py b/couchbase/datadog_checks/couchbase/couchbase_consts.py index 77613a040c3fe..b2ac22f0e1cbd 100644 --- a/couchbase/datadog_checks/couchbase/couchbase_consts.py +++ b/couchbase/datadog_checks/couchbase/couchbase_consts.py @@ -1,6 +1,6 @@ import re -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck # Paths COUCHBASE_STATS_PATH = '/pools/default' diff --git a/couchbase/tests/common.py b/couchbase/tests/common.py index 09775ded63876..c202c0ff47e2f 100644 --- a/couchbase/tests/common.py +++ b/couchbase/tests/common.py @@ -3,7 +3,7 @@ # Licensed under a 3-clause BSD style license (see LICENSE) import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/crio/datadog_checks/crio/crio.py b/crio/datadog_checks/crio/crio.py index 07a7e49407ef6..70f15fcb3f2c4 100644 --- a/crio/datadog_checks/crio/crio.py +++ b/crio/datadog_checks/crio/crio.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck class CrioCheck(OpenMetricsBaseCheck): diff --git a/directory/datadog_checks/directory/directory.py b/directory/datadog_checks/directory/directory.py index f9523cafebdeb..47590945bb435 100644 --- a/directory/datadog_checks/directory/directory.py +++ b/directory/datadog_checks/directory/directory.py @@ -6,9 +6,7 @@ from re import compile as re_compile from time import time -from datadog_checks.checks import AgentCheck -from datadog_checks.config import is_affirmative -from datadog_checks.errors import ConfigurationError +from datadog_checks.base import AgentCheck, ConfigurationError, is_affirmative from .traverse import walk diff --git a/directory/tests/test_directory.py b/directory/tests/test_directory.py index 9cb41a1938597..ef4eb996fda82 100644 --- a/directory/tests/test_directory.py +++ b/directory/tests/test_directory.py @@ -8,10 +8,10 @@ import mock import pytest +from datadog_checks.base.errors import ConfigurationError from datadog_checks.dev.utils import create_file from datadog_checks.dev.utils import temp_dir as temp_directory from datadog_checks.directory import DirectoryCheck -from datadog_checks.errors import ConfigurationError from . import common diff --git a/dns_check/datadog_checks/dns_check/dns_check.py b/dns_check/datadog_checks/dns_check/dns_check.py index 6a411d763ca2f..9479b3c75d5c9 100644 --- a/dns_check/datadog_checks/dns_check/dns_check.py +++ b/dns_check/datadog_checks/dns_check/dns_check.py @@ -9,7 +9,7 @@ import dns.resolver from datadog_checks.base import AgentCheck -from datadog_checks.utils.platform import Platform +from datadog_checks.base.utils.platform import Platform # These imports are necessary because otherwise dynamic type # resolution will fail on windows without it. diff --git a/ecs_fargate/datadog_checks/ecs_fargate/ecs_fargate.py b/ecs_fargate/datadog_checks/ecs_fargate/ecs_fargate.py index 2f9ed8c395782..ac81058cf8ea7 100644 --- a/ecs_fargate/datadog_checks/ecs_fargate/ecs_fargate.py +++ b/ecs_fargate/datadog_checks/ecs_fargate/ecs_fargate.py @@ -6,8 +6,8 @@ import requests from six import iteritems +from datadog_checks.base import AgentCheck from datadog_checks.base.utils.common import round_value -from datadog_checks.checks import AgentCheck try: from tagger import get_tags diff --git a/envoy/datadog_checks/envoy/envoy.py b/envoy/datadog_checks/envoy/envoy.py index 668137e5256f1..f205c5169e003 100644 --- a/envoy/datadog_checks/envoy/envoy.py +++ b/envoy/datadog_checks/envoy/envoy.py @@ -6,7 +6,7 @@ import requests -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck from .errors import UnknownMetric, UnknownTags from .parser import parse_histogram, parse_metric diff --git a/envoy/tests/common.py b/envoy/tests/common.py index 4b03204b169fe..3d47d68478694 100644 --- a/envoy/tests/common.py +++ b/envoy/tests/common.py @@ -1,6 +1,6 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname try: from functools import lru_cache diff --git a/fluentd/datadog_checks/fluentd/fluentd.py b/fluentd/datadog_checks/fluentd/fluentd.py index 30bc1492d51ca..ff7e3654c95bc 100644 --- a/fluentd/datadog_checks/fluentd/fluentd.py +++ b/fluentd/datadog_checks/fluentd/fluentd.py @@ -7,9 +7,8 @@ from six.moves.urllib.parse import urlparse -from datadog_checks.base import ConfigurationError +from datadog_checks.base import AgentCheck, ConfigurationError from datadog_checks.base.utils.subprocess_output import get_subprocess_output -from datadog_checks.checks import AgentCheck class Fluentd(AgentCheck): diff --git a/fluentd/tests/common.py b/fluentd/tests/common.py index a939d305c6029..47d0694fdd6e0 100644 --- a/fluentd/tests/common.py +++ b/fluentd/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.dirname(os.path.dirname(HERE)) diff --git a/gearmand/datadog_checks/gearmand/gearmand.py b/gearmand/datadog_checks/gearmand/gearmand.py index 2fb77c42e11a6..40249ed1d146d 100644 --- a/gearmand/datadog_checks/gearmand/gearmand.py +++ b/gearmand/datadog_checks/gearmand/gearmand.py @@ -5,7 +5,7 @@ from six import PY2 -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck # Python 3 compatibility is a different library # It's a drop in replacement but has a different name diff --git a/gearmand/tests/common.py b/gearmand/tests/common.py index e7b417aeb7bf3..daf4cc48d514f 100644 --- a/gearmand/tests/common.py +++ b/gearmand/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.dirname(os.path.dirname(HERE)) diff --git a/gitlab/datadog_checks/gitlab/gitlab.py b/gitlab/datadog_checks/gitlab/gitlab.py index 0dd6a38279234..b7797fb01e8e6 100644 --- a/gitlab/datadog_checks/gitlab/gitlab.py +++ b/gitlab/datadog_checks/gitlab/gitlab.py @@ -6,8 +6,8 @@ import requests from six.moves.urllib.parse import urlparse -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.errors import CheckException +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.errors import CheckException from .metrics import METRICS_MAP diff --git a/gitlab/tests/common.py b/gitlab/tests/common.py index d14353745fe59..8609f363bb98d 100644 --- a/gitlab/tests/common.py +++ b/gitlab/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/gitlab_runner/datadog_checks/gitlab_runner/gitlab_runner.py b/gitlab_runner/datadog_checks/gitlab_runner/gitlab_runner.py index 352939c3d381e..8458a80ba6d6f 100644 --- a/gitlab_runner/datadog_checks/gitlab_runner/gitlab_runner.py +++ b/gitlab_runner/datadog_checks/gitlab_runner/gitlab_runner.py @@ -7,8 +7,8 @@ import requests from six.moves.urllib.parse import urlparse -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.errors import CheckException +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.errors import CheckException class GitlabRunnerCheck(OpenMetricsBaseCheck): diff --git a/gitlab_runner/tests/common.py b/gitlab_runner/tests/common.py index 5749ba63b7b7f..fce647cf429ca 100644 --- a/gitlab_runner/tests/common.py +++ b/gitlab_runner/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/go_expvar/tests/common.py b/go_expvar/tests/common.py index d654b9d374d3b..03096c592d8c5 100644 --- a/go_expvar/tests/common.py +++ b/go_expvar/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname CHECK_NAME = "go_expvar" HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/gunicorn/datadog_checks/gunicorn/gunicorn.py b/gunicorn/datadog_checks/gunicorn/gunicorn.py index 41e137d0bc08e..5e010f69e1e03 100644 --- a/gunicorn/datadog_checks/gunicorn/gunicorn.py +++ b/gunicorn/datadog_checks/gunicorn/gunicorn.py @@ -14,9 +14,10 @@ # 3rd party import psutil +from datadog_checks.base import AgentCheck + # project from datadog_checks.base.utils.subprocess_output import get_subprocess_output -from datadog_checks.checks import AgentCheck class GUnicornCheck(AgentCheck): diff --git a/gunicorn/tests/common.py b/gunicorn/tests/common.py index d9d945c556bf5..0f255f3476e0d 100644 --- a/gunicorn/tests/common.py +++ b/gunicorn/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) COMPOSE = os.path.join(HERE, 'compose') diff --git a/haproxy/tests/common.py b/haproxy/tests/common.py index f5d7d2dd9f335..153e30b3238af 100644 --- a/haproxy/tests/common.py +++ b/haproxy/tests/common.py @@ -2,8 +2,8 @@ import pytest +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev.utils import ON_LINUX, ON_MACOS -from datadog_checks.utils.common import get_docker_hostname AGG_STATUSES_BY_SERVICE = ( (['status:available', 'service:a', 'haproxy_service:a'], 1), diff --git a/http_check/datadog_checks/http_check/config.py b/http_check/datadog_checks/http_check/config.py index 913611cd25cad..32751cdb71893 100644 --- a/http_check/datadog_checks/http_check/config.py +++ b/http_check/datadog_checks/http_check/config.py @@ -4,7 +4,7 @@ from collections import namedtuple from datadog_checks.base import ConfigurationError, ensure_unicode, is_affirmative -from datadog_checks.utils.headers import headers as agent_headers +from datadog_checks.base.utils.headers import headers as agent_headers DEFAULT_EXPECTED_CODE = r'(1|2|3)\d\d' diff --git a/http_check/tests/test_unit_config.py b/http_check/tests/test_unit_config.py index eeae29cd68500..301562b7ee7cd 100644 --- a/http_check/tests/test_unit_config.py +++ b/http_check/tests/test_unit_config.py @@ -4,8 +4,8 @@ import pytest from datadog_checks.base import ConfigurationError +from datadog_checks.base.utils.headers import headers as agent_headers from datadog_checks.http_check.config import DEFAULT_EXPECTED_CODE, from_instance -from datadog_checks.utils.headers import headers as agent_headers def test_from_instance(): diff --git a/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py b/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py index 12e49a7c1bb25..b37744a08387c 100644 --- a/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py +++ b/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py @@ -7,8 +7,7 @@ from six import iteritems -from datadog_checks.base import ensure_bytes, ensure_unicode -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck, ensure_bytes, ensure_unicode from datadog_checks.ibm_mq.metrics import COUNT, GAUGE from . import connection, errors, metrics diff --git a/iis/datadog_checks/iis/iis.py b/iis/datadog_checks/iis/iis.py index 650823ddaa2d2..768aa77da03a1 100644 --- a/iis/datadog_checks/iis/iis.py +++ b/iis/datadog_checks/iis/iis.py @@ -4,7 +4,7 @@ from six import iteritems from datadog_checks.base import PDHBaseCheck, is_affirmative -from datadog_checks.utils.containers import hash_mutable +from datadog_checks.base.utils.containers import hash_mutable DEFAULT_COUNTERS = [ ["Web Service", None, "Service Uptime", "iis.uptime", "gauge"], diff --git a/istio/datadog_checks/istio/istio.py b/istio/datadog_checks/istio/istio.py index 69b9a8775842f..c30a0e000e7db 100644 --- a/istio/datadog_checks/istio/istio.py +++ b/istio/datadog_checks/istio/istio.py @@ -4,8 +4,8 @@ from copy import deepcopy -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.errors import CheckException +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.errors import CheckException class Istio(OpenMetricsBaseCheck): diff --git a/istio/tests/test_check.py b/istio/tests/test_check.py index 1732161d1f40d..b7d89d2f32a48 100644 --- a/istio/tests/test_check.py +++ b/istio/tests/test_check.py @@ -8,8 +8,8 @@ import pytest from requests.exceptions import HTTPError +from datadog_checks.base.utils.common import ensure_unicode from datadog_checks.istio import Istio -from datadog_checks.utils.common import ensure_unicode from .common import CITADEL_METRICS, GALLEY_METRICS, MESH_METRICS, MIXER_METRICS, NEW_MIXER_METRICS, PILOT_METRICS diff --git a/kong/datadog_checks/kong/kong.py b/kong/datadog_checks/kong/kong.py index 59545268b1038..3fdf1d3a16192 100644 --- a/kong/datadog_checks/kong/kong.py +++ b/kong/datadog_checks/kong/kong.py @@ -4,7 +4,7 @@ import simplejson as json from six.moves.urllib.parse import urlparse -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class Kong(AgentCheck): diff --git a/kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py b/kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py index e4fe5491fa254..acc4f057fd9de 100644 --- a/kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py +++ b/kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py @@ -6,8 +6,8 @@ from six import iteritems -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.errors import CheckException +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.errors import CheckException class KubeAPIServerMetricsCheck(OpenMetricsBaseCheck): diff --git a/kube_controller_manager/datadog_checks/kube_controller_manager/kube_controller_manager.py b/kube_controller_manager/datadog_checks/kube_controller_manager/kube_controller_manager.py index 13a29d8ea68e0..4ff1d82a8c308 100644 --- a/kube_controller_manager/datadog_checks/kube_controller_manager/kube_controller_manager.py +++ b/kube_controller_manager/datadog_checks/kube_controller_manager/kube_controller_manager.py @@ -5,8 +5,8 @@ from six import iteritems from datadog_checks.base.checks.kube_leader import KubeLeaderElectionMixin -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.config import is_affirmative +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.config import is_affirmative class KubeControllerManagerCheck(KubeLeaderElectionMixin, OpenMetricsBaseCheck): diff --git a/kube_dns/datadog_checks/kube_dns/kube_dns.py b/kube_dns/datadog_checks/kube_dns/kube_dns.py index 572a8988780ab..a186713f6a90b 100644 --- a/kube_dns/datadog_checks/kube_dns/kube_dns.py +++ b/kube_dns/datadog_checks/kube_dns/kube_dns.py @@ -6,7 +6,7 @@ from six import iteritems -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck class KubeDNSCheck(OpenMetricsBaseCheck): diff --git a/kube_dns/tests/test_kube_dns.py b/kube_dns/tests/test_kube_dns.py index 2b0eb158c7167..1e9e93288b7fd 100644 --- a/kube_dns/tests/test_kube_dns.py +++ b/kube_dns/tests/test_kube_dns.py @@ -32,7 +32,7 @@ def mock_get(): @pytest.fixture def aggregator(): - from datadog_checks.stubs import aggregator + from datadog_checks.base.stubs import aggregator aggregator.reset() return aggregator diff --git a/kube_proxy/datadog_checks/kube_proxy/kube_proxy.py b/kube_proxy/datadog_checks/kube_proxy/kube_proxy.py index 91368145622f0..5be92511977c9 100644 --- a/kube_proxy/datadog_checks/kube_proxy/kube_proxy.py +++ b/kube_proxy/datadog_checks/kube_proxy/kube_proxy.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck class KubeProxyCheck(OpenMetricsBaseCheck): diff --git a/kube_scheduler/datadog_checks/kube_scheduler/kube_scheduler.py b/kube_scheduler/datadog_checks/kube_scheduler/kube_scheduler.py index 49921b7443edf..2b8a3278f3652 100644 --- a/kube_scheduler/datadog_checks/kube_scheduler/kube_scheduler.py +++ b/kube_scheduler/datadog_checks/kube_scheduler/kube_scheduler.py @@ -4,8 +4,8 @@ from __future__ import division from datadog_checks.base.checks.kube_leader import KubeLeaderElectionMixin -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.config import is_affirmative +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.config import is_affirmative DEFAULT_COUNTERS = { # Number of HTTP requests, partitioned by status code, method, and host. diff --git a/kubelet/datadog_checks/kubelet/kubelet.py b/kubelet/datadog_checks/kubelet/kubelet.py index fed444bddba94..305b9beee3cc6 100644 --- a/kubelet/datadog_checks/kubelet/kubelet.py +++ b/kubelet/datadog_checks/kubelet/kubelet.py @@ -15,12 +15,11 @@ from six import iteritems from urllib3.exceptions import InsecureRequestWarning +from datadog_checks.base import AgentCheck, OpenMetricsBaseCheck +from datadog_checks.base.errors import CheckException from datadog_checks.base.utils.date import UTC, parse_rfc3339 from datadog_checks.base.utils.tagging import tagger from datadog_checks.base.utils.warnings_util import disable_warnings_ctx -from datadog_checks.checks import AgentCheck -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.errors import CheckException from .cadvisor import CadvisorScraper from .common import CADVISOR_DEFAULT_PORT, KubeletCredentials, PodListUtils, replace_container_rt_prefix, urljoin diff --git a/kubelet/datadog_checks/kubelet/prometheus.py b/kubelet/datadog_checks/kubelet/prometheus.py index cf2fac43caf7a..bb81cdace253c 100644 --- a/kubelet/datadog_checks/kubelet/prometheus.py +++ b/kubelet/datadog_checks/kubelet/prometheus.py @@ -7,8 +7,8 @@ from six import iteritems +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck from datadog_checks.base.utils.tagging import tagger -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck from .common import get_pod_by_uid, is_static_pending_pod, replace_container_rt_prefix diff --git a/kubelet/tests/test_common.py b/kubelet/tests/test_common.py index ad35749ad5e17..908d269f9fdad 100644 --- a/kubelet/tests/test_common.py +++ b/kubelet/tests/test_common.py @@ -8,7 +8,7 @@ import mock import pytest -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck from datadog_checks.kubelet import KubeletCredentials, PodListUtils, get_pod_by_uid, is_static_pending_pod, urljoin from .test_kubelet import mock_from_file diff --git a/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py b/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py index 9ffddd3490449..af90e39d9103b 100644 --- a/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py +++ b/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py @@ -9,10 +9,10 @@ from six import iteritems -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck -from datadog_checks.config import is_affirmative -from datadog_checks.errors import CheckException -from datadog_checks.utils.common import to_native_string +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.config import is_affirmative +from datadog_checks.base.errors import CheckException +from datadog_checks.base.utils.common import to_native_string try: # this module is only available in agent 6 diff --git a/kubernetes_state/tests/test_kubernetes_state.py b/kubernetes_state/tests/test_kubernetes_state.py index d0fb027df11a6..e1d909a96831c 100644 --- a/kubernetes_state/tests/test_kubernetes_state.py +++ b/kubernetes_state/tests/test_kubernetes_state.py @@ -6,8 +6,8 @@ import mock import pytest +from datadog_checks.base.utils.common import ensure_unicode from datadog_checks.kubernetes_state import KubernetesState -from datadog_checks.utils.common import ensure_unicode HERE = os.path.dirname(os.path.abspath(__file__)) FIXTURES_PATH = os.path.join(HERE, 'fixtures') diff --git a/kyototycoon/datadog_checks/kyototycoon/kyototycoon.py b/kyototycoon/datadog_checks/kyototycoon/kyototycoon.py index f21fdeeee8747..df322903b8216 100644 --- a/kyototycoon/datadog_checks/kyototycoon/kyototycoon.py +++ b/kyototycoon/datadog_checks/kyototycoon/kyototycoon.py @@ -7,7 +7,7 @@ import requests -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck db_stats = re.compile(r'^db_(\d)+$') whitespace = re.compile(r'\s') diff --git a/kyototycoon/tests/common.py b/kyototycoon/tests/common.py index a98e2319eb642..e35b7a57b46c9 100644 --- a/kyototycoon/tests/common.py +++ b/kyototycoon/tests/common.py @@ -4,7 +4,7 @@ import os.path -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HOST = get_docker_hostname() PORT = '1978' diff --git a/lighttpd/datadog_checks/lighttpd/lighttpd.py b/lighttpd/datadog_checks/lighttpd/lighttpd.py index b0811b7e63f93..b3b05a8ac0cfb 100644 --- a/lighttpd/datadog_checks/lighttpd/lighttpd.py +++ b/lighttpd/datadog_checks/lighttpd/lighttpd.py @@ -6,7 +6,7 @@ from six.moves.urllib.parse import urlparse -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck VERSION_REGEX = re.compile(r".*/((\d+).*)") diff --git a/linkerd/datadog_checks/linkerd/linkerd.py b/linkerd/datadog_checks/linkerd/linkerd.py index 82275788360f7..026fe1c1e4777 100644 --- a/linkerd/datadog_checks/linkerd/linkerd.py +++ b/linkerd/datadog_checks/linkerd/linkerd.py @@ -2,7 +2,7 @@ # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck from .metrics import METRIC_MAP, TYPE_OVERRIDES diff --git a/linkerd/tests/common.py b/linkerd/tests/common.py index 5156cf62a024d..5e0b08c8cf425 100644 --- a/linkerd/tests/common.py +++ b/linkerd/tests/common.py @@ -1,4 +1,4 @@ -from datadog_checks.stubs import aggregator +from datadog_checks.base.stubs import aggregator LINKERD_FIXTURE_METRICS = { 'jvm:start_time': 'jvm.start_time', diff --git a/linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py b/linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py index 921d787f1ec73..8d4cd6648a4f0 100644 --- a/linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py +++ b/linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py @@ -7,13 +7,13 @@ from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base import AgentCheck +from datadog_checks.base.utils.subprocess_output import get_subprocess_output try: import datadog_agent except ImportError: - from datadog_checks.stubs import datadog_agent + from datadog_checks.base.stubs import datadog_agent PROCESS_STATES = { diff --git a/marathon/datadog_checks/marathon/marathon.py b/marathon/datadog_checks/marathon/marathon.py index d47e3834b3237..5bacbf863f2c9 100644 --- a/marathon/datadog_checks/marathon/marathon.py +++ b/marathon/datadog_checks/marathon/marathon.py @@ -7,7 +7,7 @@ from six import iteritems from six.moves.urllib.parse import urljoin -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class Marathon(AgentCheck): diff --git a/mesos_master/datadog_checks/mesos_master/mesos_master.py b/mesos_master/datadog_checks/mesos_master/mesos_master.py index c434ae659c8e9..59adb85f8fd13 100644 --- a/mesos_master/datadog_checks/mesos_master/mesos_master.py +++ b/mesos_master/datadog_checks/mesos_master/mesos_master.py @@ -10,8 +10,8 @@ from six import iteritems from six.moves.urllib.parse import urlparse -from datadog_checks.checks import AgentCheck -from datadog_checks.errors import CheckException +from datadog_checks.base import AgentCheck +from datadog_checks.base.errors import CheckException class MesosMaster(AgentCheck): diff --git a/mesos_master/tests/common.py b/mesos_master/tests/common.py index 134b5010fdcfd..2d926341fd992 100644 --- a/mesos_master/tests/common.py +++ b/mesos_master/tests/common.py @@ -5,9 +5,9 @@ import pytest +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev import get_here from datadog_checks.dev.utils import running_on_windows_ci -from datadog_checks.utils.common import get_docker_hostname not_windows_ci = pytest.mark.skipif(running_on_windows_ci(), reason='Test cannot be run on Windows CI') diff --git a/mesos_slave/datadog_checks/mesos_slave/mesos_slave.py b/mesos_slave/datadog_checks/mesos_slave/mesos_slave.py index 32a02094dadf1..a1d85c1ec96be 100644 --- a/mesos_slave/datadog_checks/mesos_slave/mesos_slave.py +++ b/mesos_slave/datadog_checks/mesos_slave/mesos_slave.py @@ -11,8 +11,7 @@ from six import iteritems from six.moves.urllib.parse import urlparse -from datadog_checks.checks import AgentCheck -from datadog_checks.errors import ConfigurationError +from datadog_checks.base import AgentCheck, ConfigurationError DEFAULT_MASTER_PORT = 5050 diff --git a/nfsstat/datadog_checks/nfsstat/nfsstat.py b/nfsstat/datadog_checks/nfsstat/nfsstat.py index ac38202cab948..bc6c0e57ca419 100644 --- a/nfsstat/datadog_checks/nfsstat/nfsstat.py +++ b/nfsstat/datadog_checks/nfsstat/nfsstat.py @@ -3,9 +3,8 @@ # Licensed under Simplified BSD License (see LICENSE) import os -from datadog_checks.base import ensure_unicode -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base import AgentCheck, ensure_unicode +from datadog_checks.base.utils.subprocess_output import get_subprocess_output EVENT_TYPE = SOURCE_TYPE_NAME = 'nfsstat' diff --git a/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/nginx_ingress_controller.py b/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/nginx_ingress_controller.py index 90a142386e0c5..865a16732c85e 100644 --- a/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/nginx_ingress_controller.py +++ b/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/nginx_ingress_controller.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck class NginxIngressControllerCheck(OpenMetricsBaseCheck): diff --git a/openldap/tests/test_check.py b/openldap/tests/test_check.py index 5f6386ebe4968..75fab632a8bba 100644 --- a/openldap/tests/test_check.py +++ b/openldap/tests/test_check.py @@ -6,7 +6,7 @@ import ldap3 import pytest -from datadog_checks.utils.platform import Platform +from datadog_checks.base.utils.platform import Platform from .common import _check diff --git a/openldap/tests/test_unit.py b/openldap/tests/test_unit.py index fdb23f158efa2..750c4f9bfa9a1 100644 --- a/openldap/tests/test_unit.py +++ b/openldap/tests/test_unit.py @@ -7,7 +7,7 @@ import ldap3 import pytest -from datadog_checks.errors import CheckException +from datadog_checks.base.errors import CheckException from .common import HERE diff --git a/openmetrics/datadog_checks/openmetrics/openmetrics.py b/openmetrics/datadog_checks/openmetrics/openmetrics.py index caed11f6f4c7d..26647d34d0e04 100644 --- a/openmetrics/datadog_checks/openmetrics/openmetrics.py +++ b/openmetrics/datadog_checks/openmetrics/openmetrics.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck +from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck class OpenMetricsCheck(OpenMetricsBaseCheck): diff --git a/openstack/tests/test_openstack.py b/openstack/tests/test_openstack.py index 1685c16b97ac7..49096578c9d1d 100644 --- a/openstack/tests/test_openstack.py +++ b/openstack/tests/test_openstack.py @@ -9,7 +9,7 @@ import pytest from six import iteritems -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck from datadog_checks.openstack.openstack import ( IncompleteAuthScope, IncompleteConfig, diff --git a/pdh_check/datadog_checks/pdh_check/pdh_check.py b/pdh_check/datadog_checks/pdh_check/pdh_check.py index 935f063159a5e..975b728925608 100644 --- a/pdh_check/datadog_checks/pdh_check/pdh_check.py +++ b/pdh_check/datadog_checks/pdh_check/pdh_check.py @@ -2,7 +2,7 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) -from datadog_checks.checks.win import PDHBaseCheck +from datadog_checks.base.checks.win import PDHBaseCheck class PDHCheck(PDHBaseCheck): diff --git a/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py b/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py index d78bca22e8ba3..6af3ec181ba08 100644 --- a/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py +++ b/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py @@ -7,9 +7,7 @@ import psycopg2.extras as pgextras from six.moves.urllib.parse import urlparse -from datadog_checks.base import ConfigurationError -from datadog_checks.checks import AgentCheck -from datadog_checks.config import is_affirmative +from datadog_checks.base import AgentCheck, ConfigurationError, is_affirmative from datadog_checks.pgbouncer.metrics import DATABASES_METRICS, POOLS_METRICS, STATS_METRICS diff --git a/pgbouncer/tests/common.py b/pgbouncer/tests/common.py index 1259b21acbe1e..cf9ed8f2a95a6 100644 --- a/pgbouncer/tests/common.py +++ b/pgbouncer/tests/common.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HOST = get_docker_hostname() PORT = '6432' diff --git a/php_fpm/datadog_checks/php_fpm/php_fpm.py b/php_fpm/datadog_checks/php_fpm/php_fpm.py index d14c86072b121..241a1fb9034fc 100644 --- a/php_fpm/datadog_checks/php_fpm/php_fpm.py +++ b/php_fpm/datadog_checks/php_fpm/php_fpm.py @@ -9,8 +9,7 @@ from six import PY3, StringIO, iteritems, string_types from six.moves.urllib.parse import urlparse -from datadog_checks.checks import AgentCheck -from datadog_checks.config import is_affirmative +from datadog_checks.base import AgentCheck, is_affirmative # Relax param filtering FCGIApp._environPrefixes.extend(('DOCUMENT_', 'SCRIPT_')) diff --git a/postfix/datadog_checks/postfix/postfix.py b/postfix/datadog_checks/postfix/postfix.py index 85a3c957b7b5b..4b739bfa68fbe 100644 --- a/postfix/datadog_checks/postfix/postfix.py +++ b/postfix/datadog_checks/postfix/postfix.py @@ -7,8 +7,8 @@ import os # project -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base import AgentCheck +from datadog_checks.base.utils.subprocess_output import get_subprocess_output class PostfixCheck(AgentCheck): diff --git a/powerdns_recursor/datadog_checks/powerdns_recursor/powerdns_recursor.py b/powerdns_recursor/datadog_checks/powerdns_recursor/powerdns_recursor.py index 3118874e27983..1d16b9a914366 100644 --- a/powerdns_recursor/datadog_checks/powerdns_recursor/powerdns_recursor.py +++ b/powerdns_recursor/datadog_checks/powerdns_recursor/powerdns_recursor.py @@ -3,7 +3,7 @@ # Licensed under Simplified BSD License (see LICENSE) from collections import namedtuple -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class PowerDNSRecursorCheck(AgentCheck): diff --git a/powerdns_recursor/tests/common.py b/powerdns_recursor/tests/common.py index 84a936389410d..ef0f0a91c8060 100644 --- a/powerdns_recursor/tests/common.py +++ b/powerdns_recursor/tests/common.py @@ -6,7 +6,7 @@ import requests -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HOST = get_docker_hostname() PORT = os.getenv('POWERDNS_HOST_PORT_0', 8082) diff --git a/process/datadog_checks/process/process.py b/process/datadog_checks/process/process.py index 51e36e78acba3..9ad9537ae223e 100644 --- a/process/datadog_checks/process/process.py +++ b/process/datadog_checks/process/process.py @@ -12,9 +12,9 @@ import psutil from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative -from datadog_checks.utils.platform import Platform +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative +from datadog_checks.base.utils.platform import Platform from .cache import DEFAULT_SHARED_PROCESS_LIST_CACHE_DURATION, ProcessListCache diff --git a/process/tests/test_process.py b/process/tests/test_process.py index 000b0b537d1ae..9404238c6c1ff 100644 --- a/process/tests/test_process.py +++ b/process/tests/test_process.py @@ -230,7 +230,7 @@ def test_check_missing_process(aggregator, caplog): def test_check_real_process(aggregator): "Check that we detect python running (at least this process)" - from datadog_checks.utils.platform import Platform + from datadog_checks.base.utils.platform import Platform instance = { 'name': 'py', @@ -270,7 +270,7 @@ def test_check_real_process(aggregator): def test_check_real_process_regex(aggregator): "Check to specifically find this python pytest running process using regex." - from datadog_checks.utils.platform import Platform + from datadog_checks.base.utils.platform import Platform instance = { 'name': 'py', diff --git a/prometheus/datadog_checks/prometheus/prometheus.py b/prometheus/datadog_checks/prometheus/prometheus.py index 0fae3b6510363..320c1c82f326d 100644 --- a/prometheus/datadog_checks/prometheus/prometheus.py +++ b/prometheus/datadog_checks/prometheus/prometheus.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.checks.prometheus import GenericPrometheusCheck +from datadog_checks.base.checks.prometheus import GenericPrometheusCheck class PrometheusCheck(GenericPrometheusCheck): diff --git a/rabbitmq/tests/common.py b/rabbitmq/tests/common.py index 7c348c564abc3..440fa9c2c1fbc 100644 --- a/rabbitmq/tests/common.py +++ b/rabbitmq/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.dirname(os.path.dirname(HERE)) diff --git a/rabbitmq/tests/test_unit.py b/rabbitmq/tests/test_unit.py index 7b56d20bf67e8..c626067fe0d1f 100644 --- a/rabbitmq/tests/test_unit.py +++ b/rabbitmq/tests/test_unit.py @@ -7,7 +7,7 @@ import requests from tests.common import EXCHANGE_MESSAGE_STATS -import datadog_checks +import datadog_checks.base from datadog_checks.rabbitmq import RabbitMQ from datadog_checks.rabbitmq.rabbitmq import EXCHANGE_TYPE, NODE_TYPE, OVERVIEW_TYPE, RabbitMQException diff --git a/riak/datadog_checks/riak/riak.py b/riak/datadog_checks/riak/riak.py index 7c447aa0c557e..35d1ec6eb309a 100644 --- a/riak/datadog_checks/riak/riak.py +++ b/riak/datadog_checks/riak/riak.py @@ -8,7 +8,7 @@ import simplejson as json from httplib2 import Http, HttpLib2Error -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class Riak(AgentCheck): diff --git a/riakcs/datadog_checks/riakcs/riakcs.py b/riakcs/datadog_checks/riakcs/riakcs.py index e7716b35dd8b3..786e63c148a59 100644 --- a/riakcs/datadog_checks/riakcs/riakcs.py +++ b/riakcs/datadog_checks/riakcs/riakcs.py @@ -9,8 +9,8 @@ from boto.s3.connection import S3Connection from six import iteritems -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative def multidict(ordered_pairs): diff --git a/snmp/tests/common.py b/snmp/tests/common.py index bb3e0bd2c09f0..d000d100bbfb2 100644 --- a/snmp/tests/common.py +++ b/snmp/tests/common.py @@ -7,9 +7,9 @@ import os from datadog_checks.base.stubs.aggregator import AggregatorStub +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev.docker import get_container_ip from datadog_checks.snmp import SnmpCheck -from datadog_checks.utils.common import get_docker_hostname log = logging.getLogger(__name__) diff --git a/sqlserver/datadog_checks/sqlserver/sqlserver.py b/sqlserver/datadog_checks/sqlserver/sqlserver.py index 39c2141609806..2d5661a04270a 100644 --- a/sqlserver/datadog_checks/sqlserver/sqlserver.py +++ b/sqlserver/datadog_checks/sqlserver/sqlserver.py @@ -13,8 +13,8 @@ from six import raise_from -from datadog_checks.checks import AgentCheck -from datadog_checks.config import is_affirmative +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import is_affirmative try: import adodbapi diff --git a/squid/datadog_checks/squid/squid.py b/squid/datadog_checks/squid/squid.py index 66b6eb6190fa6..7975d22cacbc6 100644 --- a/squid/datadog_checks/squid/squid.py +++ b/squid/datadog_checks/squid/squid.py @@ -8,7 +8,7 @@ from six import iteritems # project -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck EVENT_TYPE = SOURCE_TYPE_NAME = 'squid' diff --git a/squid/tests/common.py b/squid/tests/common.py index 547dfd3930794..37e5a7acd093b 100644 --- a/squid/tests/common.py +++ b/squid/tests/common.py @@ -3,7 +3,7 @@ # Licensed under Simplified BSD License (see LICENSE) import os -from datadog_checks.utils.common import get_docker_hostname +from datadog_checks.base.utils.common import get_docker_hostname CHECK_NAME = "squid" HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/ssh_check/datadog_checks/ssh_check/ssh_check.py b/ssh_check/datadog_checks/ssh_check/ssh_check.py index 814e97803f519..a43ca41bf158b 100644 --- a/ssh_check/datadog_checks/ssh_check/ssh_check.py +++ b/ssh_check/datadog_checks/ssh_check/ssh_check.py @@ -7,7 +7,7 @@ import paramiko -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck # Example ssh remote version: http://supervisord.org/changes.html # - SSH-2.0-OpenSSH_8.1 diff --git a/statsd/datadog_checks/statsd/statsd.py b/statsd/datadog_checks/statsd/statsd.py index 0cbf2f480c8df..a8bf7530252b3 100644 --- a/statsd/datadog_checks/statsd/statsd.py +++ b/statsd/datadog_checks/statsd/statsd.py @@ -7,8 +7,7 @@ from six import BytesIO -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.common import ensure_bytes, ensure_unicode +from datadog_checks.base import AgentCheck, ensure_bytes, ensure_unicode SERVICE_CHECK_NAME = "statsd.can_connect" SERVICE_CHECK_NAME_HEALTH = "statsd.is_up" diff --git a/supervisord/tests/common.py b/supervisord/tests/common.py index c5671bf663d01..22e2c6d793c44 100644 --- a/supervisord/tests/common.py +++ b/supervisord/tests/common.py @@ -4,7 +4,7 @@ import os -from datadog_checks.checks.base import ServiceCheck +from datadog_checks.base.checks.base import ServiceCheck from datadog_checks.dev import get_docker_hostname PROCESSES = ["program_0", "program_1", "program_2"] diff --git a/system_core/datadog_checks/system_core/system_core.py b/system_core/datadog_checks/system_core/system_core.py index b0125a56ad824..e870845eb3d89 100644 --- a/system_core/datadog_checks/system_core/system_core.py +++ b/system_core/datadog_checks/system_core/system_core.py @@ -4,7 +4,7 @@ import psutil from six import iteritems -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class SystemCore(AgentCheck): diff --git a/system_core/tests/common.py b/system_core/tests/common.py index b7613fd48e4ec..35801e11f143a 100644 --- a/system_core/tests/common.py +++ b/system_core/tests/common.py @@ -3,8 +3,8 @@ # Licensed under a 3-clause BSD style license (see LICENSE) import psutil +from datadog_checks.base.utils.platform import Platform from datadog_checks.dev import get_here -from datadog_checks.utils.platform import Platform HERE = get_here() CHECK_NAME = "system_core" diff --git a/system_swap/datadog_checks/system_swap/system_swap.py b/system_swap/datadog_checks/system_swap/system_swap.py index 7cea7f70d252a..1f082b61b3454 100644 --- a/system_swap/datadog_checks/system_swap/system_swap.py +++ b/system_swap/datadog_checks/system_swap/system_swap.py @@ -6,7 +6,7 @@ import psutil # project -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck class SystemSwap(AgentCheck): diff --git a/teamcity/datadog_checks/teamcity/teamcity.py b/teamcity/datadog_checks/teamcity/teamcity.py index 6e5c66192ccfb..119b909adc0c8 100644 --- a/teamcity/datadog_checks/teamcity/teamcity.py +++ b/teamcity/datadog_checks/teamcity/teamcity.py @@ -6,8 +6,8 @@ import requests -from datadog_checks.checks import AgentCheck -from datadog_checks.config import _is_affirmative +from datadog_checks.base import AgentCheck +from datadog_checks.base.config import _is_affirmative class TeamCityCheck(AgentCheck): diff --git a/tokumx/datadog_checks/tokumx/tokumx.py b/tokumx/datadog_checks/tokumx/tokumx.py index f64f50ce8fd61..032d8114b0626 100644 --- a/tokumx/datadog_checks/tokumx/tokumx.py +++ b/tokumx/datadog_checks/tokumx/tokumx.py @@ -8,7 +8,7 @@ from six import PY3, iteritems -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck from datadog_checks.tokumx.vendor import bson from datadog_checks.tokumx.vendor.pymongo import MongoClient, ReadPreference, errors, uri_parser from datadog_checks.tokumx.vendor.pymongo import version as py_version diff --git a/varnish/datadog_checks/varnish/varnish.py b/varnish/datadog_checks/varnish/varnish.py index 549a38a89647e..db05bd66c1313 100644 --- a/varnish/datadog_checks/varnish/varnish.py +++ b/varnish/datadog_checks/varnish/varnish.py @@ -11,8 +11,8 @@ from six import PY3, iteritems from six.moves import filter -from datadog_checks.checks import AgentCheck -from datadog_checks.utils.subprocess_output import get_subprocess_output +from datadog_checks.base.checks import AgentCheck +from datadog_checks.base.utils.subprocess_output import get_subprocess_output if PY3: long = int diff --git a/vsphere/datadog_checks/vsphere/legacy/errors.py b/vsphere/datadog_checks/vsphere/legacy/errors.py index 75c1b816620f0..27232a7382301 100644 --- a/vsphere/datadog_checks/vsphere/legacy/errors.py +++ b/vsphere/datadog_checks/vsphere/legacy/errors.py @@ -1,7 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -from datadog_checks.errors import CheckException +from datadog_checks.base.errors import CheckException class BadConfigError(CheckException): diff --git a/vsphere/datadog_checks/vsphere/legacy/vsphere_legacy.py b/vsphere/datadog_checks/vsphere/legacy/vsphere_legacy.py index 9a5e6f1eeea67..84f64d38d4808 100644 --- a/vsphere/datadog_checks/vsphere/legacy/vsphere_legacy.py +++ b/vsphere/datadog_checks/vsphere/legacy/vsphere_legacy.py @@ -18,8 +18,7 @@ from six import itervalues from six.moves import range -from datadog_checks.base import ensure_unicode, to_native_string -from datadog_checks.base.checks import AgentCheck +from datadog_checks.base import AgentCheck, ensure_unicode, to_native_string from datadog_checks.base.checks.libs.thread_pool import SENTINEL, Pool from datadog_checks.base.checks.libs.timer import Timer from datadog_checks.base.checks.libs.vmware.all_metrics import ALL_METRICS diff --git a/vsphere/datadog_checks/vsphere/vsphere.py b/vsphere/datadog_checks/vsphere/vsphere.py index c5be202a74943..a9bd930060cae 100644 --- a/vsphere/datadog_checks/vsphere/vsphere.py +++ b/vsphere/datadog_checks/vsphere/vsphere.py @@ -13,7 +13,7 @@ from datadog_checks.base import AgentCheck, is_affirmative, to_native_string from datadog_checks.base.checks.libs.timer import Timer -from datadog_checks.stubs import datadog_agent +from datadog_checks.base.stubs import datadog_agent from datadog_checks.vsphere.api import APIConnectionError, VSphereAPI from datadog_checks.vsphere.api_rest import VSphereRestAPI from datadog_checks.vsphere.cache import InfrastructureCache, MetricsMetadataCache, TagsCache diff --git a/vsphere/tests/legacy/conftest.py b/vsphere/tests/legacy/conftest.py index 716e3f35d02f8..54246cb28febd 100644 --- a/vsphere/tests/legacy/conftest.py +++ b/vsphere/tests/legacy/conftest.py @@ -41,7 +41,7 @@ def vsphere(): @pytest.fixture def aggregator(): - from datadog_checks.stubs import aggregator + from datadog_checks.base.stubs import aggregator aggregator.reset() return aggregator diff --git a/windows_service/datadog_checks/windows_service/windows_service.py b/windows_service/datadog_checks/windows_service/windows_service.py index 3e5af6f2f7681..9c1226dc0940a 100644 --- a/windows_service/datadog_checks/windows_service/windows_service.py +++ b/windows_service/datadog_checks/windows_service/windows_service.py @@ -6,7 +6,7 @@ import win32service from six import iteritems -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck SERVICE_PATTERN_FLAGS = re.IGNORECASE diff --git a/wmi_check/datadog_checks/wmi_check/wmi_check.py b/wmi_check/datadog_checks/wmi_check/wmi_check.py index 6b56e4859d165..641f33dc9af85 100644 --- a/wmi_check/datadog_checks/wmi_check/wmi_check.py +++ b/wmi_check/datadog_checks/wmi_check/wmi_check.py @@ -2,9 +2,9 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) -from datadog_checks.checks.win.wmi import WinWMICheck -from datadog_checks.utils.containers import hash_mutable -from datadog_checks.utils.timeout import TimeoutException +from datadog_checks.base.checks.win.wmi import WinWMICheck +from datadog_checks.base.utils.containers import hash_mutable +from datadog_checks.base.utils.timeout import TimeoutException class WMICheck(WinWMICheck): diff --git a/yarn/datadog_checks/yarn/yarn.py b/yarn/datadog_checks/yarn/yarn.py index 866078cdad5ea..c1ea7b8d3aed1 100644 --- a/yarn/datadog_checks/yarn/yarn.py +++ b/yarn/datadog_checks/yarn/yarn.py @@ -6,7 +6,7 @@ from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit from datadog_checks.base import AgentCheck, is_affirmative -from datadog_checks.errors import ConfigurationError +from datadog_checks.base.errors import ConfigurationError # Default settings DEFAULT_RM_URI = 'http://localhost:8088' diff --git a/zk/datadog_checks/zk/zk.py b/zk/datadog_checks/zk/zk.py index 411481db1d9ed..8c781d144eb1c 100644 --- a/zk/datadog_checks/zk/zk.py +++ b/zk/datadog_checks/zk/zk.py @@ -64,8 +64,7 @@ from six import PY3, StringIO, iteritems -from datadog_checks.base import ensure_bytes, ensure_unicode -from datadog_checks.checks import AgentCheck +from datadog_checks.base import AgentCheck, ensure_bytes, ensure_unicode if PY3: long = int diff --git a/zk/tests/conftest.py b/zk/tests/conftest.py index 573b2ebc50ec3..83c2994b53f33 100644 --- a/zk/tests/conftest.py +++ b/zk/tests/conftest.py @@ -7,8 +7,8 @@ import pytest +from datadog_checks.base.utils.common import get_docker_hostname from datadog_checks.dev import RetryError, docker_run -from datadog_checks.utils.common import get_docker_hostname from datadog_checks.zk import ZookeeperCheck from datadog_checks.zk.zk import ZKConnectionFailure