Skip to content

Commit

Permalink
Import the full module namespace to avoid import shadowing.
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Mar 28, 2017
1 parent ff8cb04 commit 9b1e55a
Show file tree
Hide file tree
Showing 383 changed files with 404 additions and 400 deletions.
2 changes: 1 addition & 1 deletion tests/unit/beacons/test_status.py
Expand Up @@ -17,7 +17,7 @@
import salt.config
import salt.loader
from salt.beacons import status
from salt.modules import status as status_module
import salt.modules.status as status_module

# Salt testing libs
from tests.support.unit import TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_alternatives.py
Expand Up @@ -17,7 +17,7 @@
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch

# Import salt libs
from salt.modules import alternatives
import salt.modules.alternatives as alternatives


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_apache.py
Expand Up @@ -18,7 +18,7 @@
)

# Import Salt Libs
from salt.modules import apache
import salt.modules.apache as apache
from salt.ext.six.moves.urllib.error import URLError # pylint: disable=import-error,no-name-in-module


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_aptpkg.py
Expand Up @@ -17,7 +17,7 @@

# Import Salt Libs
from salt.exceptions import CommandExecutionError, SaltInvocationError
from salt.modules import aptpkg
import salt.modules.aptpkg as aptpkg


APT_KEY_LIST = r'''
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_archive.py
Expand Up @@ -16,7 +16,7 @@
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch

# Import salt libs
from salt.modules import archive
import salt.modules.archive as archive
from salt.exceptions import CommandNotFoundError
from salt.utils import which_bin

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_artifactory.py
Expand Up @@ -9,7 +9,7 @@
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch

# Import Salt libs
from salt.modules import artifactory
import salt.modules.artifactory as artifactory


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_at.py
Expand Up @@ -18,7 +18,7 @@

# Import Salt Libs
import salt.utils
from salt.modules import at
import salt.modules.at as at


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_augeas_cfg.py
Expand Up @@ -13,7 +13,7 @@
patch,
)
# Import Salt Libs
from salt.modules import augeas_cfg
import salt.modules.augeas_cfg as augeas_cfg
from salt.exceptions import SaltInvocationError
# Make sure augeas python interface is installed
if augeas_cfg.HAS_AUGEAS:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_bluez.py
Expand Up @@ -17,7 +17,7 @@
)

# Import Salt Libs
from salt.modules import bluez
import salt.modules.bluez as bluez
from salt.exceptions import CommandExecutionError
import salt.utils.validate.net

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_apigateway.py
Expand Up @@ -14,7 +14,7 @@

# Import Salt libs
import salt.loader
from salt.modules import boto_apigateway
import salt.modules.boto_apigateway as boto_apigateway
from salt.utils.versions import LooseVersion

# Import 3rd-party libs
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_cloudtrail.py
Expand Up @@ -19,7 +19,7 @@
# Import Salt libs
import salt.config
import salt.loader
from salt.modules import boto_cloudtrail
import salt.modules.boto_cloudtrail as boto_cloudtrail
from salt.utils.versions import LooseVersion
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_cognitoidentity.py
Expand Up @@ -15,7 +15,7 @@
import salt.config
import salt.loader
from salt.utils.versions import LooseVersion
from salt.modules import boto_cognitoidentity
import salt.modules.boto_cognitoidentity as boto_cognitoidentity

# Import 3rd-party libs

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_elasticsearch_domain.py
Expand Up @@ -21,7 +21,7 @@
import salt.ext.six as six
import salt.loader
from salt.utils.versions import LooseVersion
from salt.modules import boto_elasticsearch_domain
import salt.modules.boto_elasticsearch_domain as boto_elasticsearch_domain

# Import 3rd-party libs

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_iot.py
Expand Up @@ -19,7 +19,7 @@
# Import Salt libs
import salt.config
import salt.loader
from salt.modules import boto_iot
import salt.modules.boto_iot as boto_iot
from salt.utils.versions import LooseVersion
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_s3_bucket.py
Expand Up @@ -19,7 +19,7 @@

# Import Salt libs
import salt.loader
from salt.modules import boto_s3_bucket
import salt.modules.boto_s3_bucket as boto_s3_bucket
from salt.utils.versions import LooseVersion

# Import 3rd-party libs
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_boto_vpc.py
Expand Up @@ -20,7 +20,7 @@
# Import Salt libs
import salt.config
import salt.loader
from salt.modules import boto_vpc
import salt.modules.boto_vpc as boto_vpc
from salt.utils.versions import LooseVersion
from salt.exceptions import SaltInvocationError, CommandExecutionError
from salt.modules.boto_vpc import _maybe_set_name_tag, _maybe_set_tags
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_bower.py
Expand Up @@ -12,7 +12,7 @@
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON

# Import Salt Libs
from salt.modules import bower
import salt.modules.bower as bower
from salt.exceptions import CommandExecutionError


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_bridge.py
Expand Up @@ -12,7 +12,7 @@
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON

# Import Salt Libs
from salt.modules import bridge
import salt.modules.bridge as bridge


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_btrfs.py
Expand Up @@ -19,7 +19,7 @@
# Import Salt Libs
import salt
import salt.utils.fsutils
from salt.modules import btrfs
import salt.modules.btrfs as btrfs
from salt.exceptions import CommandExecutionError


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cassandra.py
Expand Up @@ -17,7 +17,7 @@

# Import Salt Libs
import salt.ext.six as six
from salt.modules import cassandra
import salt.modules.cassandra as cassandra


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cassandra_cql.py
Expand Up @@ -12,7 +12,7 @@
from tests.support.unit import TestCase, skipIf

# Import salt libs
from salt.modules import cassandra_cql
import salt.modules.cassandra_cql as cassandra_cql
from salt.exceptions import CommandExecutionError

cassandra_cql.__salt__ = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_chef.py
Expand Up @@ -16,7 +16,7 @@
)

# Import Salt Libs
from salt.modules import chef
import salt.modules.chef as chef


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cmdmod.py
Expand Up @@ -7,7 +7,7 @@
from __future__ import absolute_import

# Import Salt Libs
from salt.modules import cmdmod
import salt.modules.cmdmod as cmdmod
from salt.exceptions import CommandExecutionError
from salt.log import LOG_LEVELS
import salt.utils
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_composer.py
Expand Up @@ -17,7 +17,7 @@
)

# Import Salt Libs
from salt.modules import composer
import salt.modules.composer as composer
from salt.exceptions import CommandExecutionError, CommandNotFoundError, SaltInvocationError


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_config.py
Expand Up @@ -9,7 +9,7 @@
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch

# Import Salt libs
from salt.modules import config
import salt.modules.config as config

DEFAULTS = {
'test.option.all': 'value of test.option.all in DEFAULTS',
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cp.py
Expand Up @@ -19,7 +19,7 @@
)

# Import Salt Libs
from salt.modules import cp
import salt.modules.cp as cp
from salt.utils import templates
from salt.exceptions import CommandExecutionError
import salt.utils
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cpan.py
Expand Up @@ -15,7 +15,7 @@
NO_MOCK_REASON
)
# Import Salt Libs
from salt.modules import cpan
import salt.modules.cpan as cpan


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_cron.py
Expand Up @@ -12,7 +12,7 @@
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch, call

# Import Salt libs
from salt.modules import cron
import salt.modules.cron as cron
from salt.ext.six.moves import builtins, StringIO

STUB_USER = 'root'
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_daemontools.py
Expand Up @@ -18,7 +18,7 @@
import os

# Import Salt Libs
from salt.modules import daemontools
import salt.modules.daemontools as daemontools
from salt.exceptions import CommandExecutionError


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_data.py
Expand Up @@ -17,7 +17,7 @@
)

# Import Salt Libs
from salt.modules import data
import salt.modules.data as data


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_ddns.py
Expand Up @@ -26,7 +26,7 @@
)

# Import Salt Libs
from salt.modules import ddns
import salt.modules.ddns as ddns


@skipIf(HAS_DNS is False, 'dnspython libs not installed')
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_deb_apache.py
Expand Up @@ -16,7 +16,7 @@
)

# Import Salt Libs
from salt.modules import deb_apache
import salt.modules.deb_apache as deb_apache
# Globals
deb_apache.__grains__ = {}
deb_apache.__salt__ = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_deb_postgres.py
Expand Up @@ -9,7 +9,7 @@

# Import salt libs
import salt.ext.six as six
from salt.modules import deb_postgres
import salt.modules.deb_postgres as deb_postgres

deb_postgres.__grains__ = None # in order to stub it w/patch below
deb_postgres.__salt__ = None # in order to stub it w/patch below
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_debconfmod.py
Expand Up @@ -16,7 +16,7 @@
)

# Import Salt Libs
from salt.modules import debconfmod
import salt.modules.debconfmod as debconfmod
import os


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_debian_ip.py
Expand Up @@ -16,7 +16,7 @@
)

# Import Salt Libs
from salt.modules import debian_ip
import salt.modules.debian_ip as debian_ip

# Import third party libs
import jinja2.exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_debian_service.py
Expand Up @@ -15,7 +15,7 @@
)

# Import Salt Libs
from salt.modules import debian_service
import salt.modules.debian_service as debian_service


# Globals
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_defaults.py
Expand Up @@ -17,7 +17,7 @@
)

# Import Salt Libs
from salt.modules import defaults
import salt.modules.defaults as defaults


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_devmap.py
Expand Up @@ -18,7 +18,7 @@
)

# Import Salt Libs
from salt.modules import devmap
import salt.modules.devmap as devmap


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_dig.py
Expand Up @@ -11,7 +11,7 @@
from tests.support.mock import MagicMock, patch, NO_MOCK, NO_MOCK_REASON

# Import salt libs
from salt.modules import dig
import salt.modules.dig as dig


_SPF_VALUES = {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_disk.py
Expand Up @@ -12,7 +12,7 @@
from tests.support.mock import MagicMock, patch

# Import Salt libs
from salt.modules import disk
import salt.modules.disk as disk
import salt.utils

STUB_DISK_USAGE = {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_djangomod.py
Expand Up @@ -16,7 +16,7 @@
)

# Import Salt Libs
from salt.modules import djangomod
import salt.modules.djangomod as djangomod


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_dnsmasq.py
Expand Up @@ -19,7 +19,7 @@

# Import Salt Libs
from salt.exceptions import CommandExecutionError
from salt.modules import dnsmasq
import salt.modules.dnsmasq as dnsmasq


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_dnsutil.py
Expand Up @@ -19,7 +19,7 @@
)

# Import Salt Libs
from salt.modules import dnsutil
import salt.modules.dnsutil as dnsutil

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_dpkg.py
Expand Up @@ -17,7 +17,7 @@
)

# Import Salt Libs
from salt.modules import dpkg
import salt.modules.dpkg as dpkg


@skipIf(NO_MOCK, NO_MOCK_REASON)
Expand Down

0 comments on commit 9b1e55a

Please sign in to comment.