Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated imports #6088

Merged
merged 7 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions activemq_xml/datadog_checks/activemq_xml/activemq_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
mgarabed marked this conversation as resolved.
Show resolved Hide resolved

QUEUE_URL = "/admin/xml/queues.jsp"
TOPIC_URL = "/admin/xml/topics.jsp"
Expand Down
2 changes: 1 addition & 1 deletion activemq_xml/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion ambari/tests/test_ambari.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion btrfs/datadog_checks/btrfs/btrfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cacti/datadog_checks/cacti/cacti.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import pymysql

from datadog_checks.checks import AgentCheck
from datadog_checks.base import AgentCheck

try:
import rrdtool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions ceph/datadog_checks/ceph/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion cilium/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions cisco_aci/datadog_checks/cisco_aci/cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/datadog_checks/cisco_aci/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/tests/test_capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/tests/test_cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/tests/test_fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/tests/test_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cockroachdb/datadog_checks/cockroachdb/cockroachdb.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion coredns/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions couch/datadog_checks/couch/couch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion couch/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions couchbase/datadog_checks/couchbase/couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,7 +28,6 @@
SOURCE_TYPE_NAME,
TO_SECONDS,
)
from datadog_checks.utils.containers import hash_mutable


class Couchbase(AgentCheck):
Expand Down
2 changes: 1 addition & 1 deletion couchbase/datadog_checks/couchbase/couchbase_consts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from datadog_checks.checks import AgentCheck
from datadog_checks.base import AgentCheck

# Paths
COUCHBASE_STATS_PATH = '/pools/default'
Expand Down
2 changes: 1 addition & 1 deletion couchbase/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down
2 changes: 1 addition & 1 deletion crio/datadog_checks/crio/crio.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
4 changes: 1 addition & 3 deletions directory/datadog_checks/directory/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion directory/tests/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion dns_check/datadog_checks/dns_check/dns_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ecs_fargate/datadog_checks/ecs_fargate/ecs_fargate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion envoy/datadog_checks/envoy/envoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion envoy/tests/common.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions fluentd/datadog_checks/fluentd/fluentd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion fluentd/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion gearmand/datadog_checks/gearmand/gearmand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gearmand/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions gitlab/datadog_checks/gitlab/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gitlab/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down
4 changes: 2 additions & 2 deletions gitlab_runner/datadog_checks/gitlab_runner/gitlab_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion gitlab_runner/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down
Loading