Rename docker execution module to avoid shadowing in the loader

With the merging of #39996, salt/modules/docker.py now imports
salt.utils.docker. However, our loader appends the module dir (in
this case salt/modules/) to sys.path temporarily for the length of the
loading process. So, as the docker execution module tries to import
salt.utils.docker, when salt.utils.docker attempts to do an "import
docker", and docker-py is *not* installed, this results in
salt/modules/docker.py (the docker execution module) being loaded in its
place, which results in tracebacks in the minion log.

Renaming the docker execution module keeps this import shadowing from
occurring. Note that we don't need to do this for the placeholder
salt/states/docker.py as it does not import salt.utils.docker.
This commit is contained in:
Erik Johnson 2017-03-23 15:33:56 -05:00
parent 37b5a3ccda
commit 774a3f1147
8 changed files with 12 additions and 12 deletions

View File

@ -109,7 +109,7 @@ execution modules
dnsmasq
dnsutil
dockercompose
docker
dockermod
dpkg
drac
dracr

View File

@ -1,7 +0,0 @@
===================
salt.modules.docker
===================
.. automodule:: salt.modules.docker
:members:
:exclude-members: cp, freeze, unfreeze

View File

@ -0,0 +1,7 @@
======================
salt.modules.dockermod
======================
.. automodule:: salt.modules.dockermod
:members:
:exclude-members: cp, freeze, unfreeze

View File

@ -19,7 +19,7 @@ from tests.support.mock import (
# Import Salt Libs
from salt.ext.six.moves import range
from salt.exceptions import CommandExecutionError
import salt.modules.docker as docker_mod
import salt.modules.dockermod as docker_mod
docker_mod.__context__ = {'docker.docker_version': ''}
docker_mod.__salt__ = {}

View File

@ -17,7 +17,7 @@ from tests.support.mock import (
# Import Salt Libs
from salt.exceptions import CommandExecutionError
import salt.modules.docker as docker_mod
import salt.modules.dockermod as docker_mod
import salt.states.docker_image as docker_state
docker_mod.__context__ = {'docker.docker_version': ''}

View File

@ -16,7 +16,7 @@ from tests.support.mock import (
)
# Import Salt Libs
import salt.modules.docker as docker_mod
import salt.modules.dockermod as docker_mod
import salt.states.docker_network as docker_state
docker_mod.__context__ = {'docker.docker_version': ''}

View File

@ -16,7 +16,7 @@ from tests.support.mock import (
)
# Import Salt Libs
import salt.modules.docker as docker_mod
import salt.modules.dockermod as docker_mod
import salt.states.docker_volume as docker_state
docker_mod.__context__ = {'docker.docker_version': ''}