mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 20:08:41 +00:00
Make sure plugins/module_utils/socket_handler.py works when Docker SDK for Python is not installed. (#620)
This commit is contained in:
parent
7bdb2127e0
commit
d7f7e44b9e
2
changelogs/fragments/620-bugfixes.yml
Normal file
2
changelogs/fragments/620-bugfixes.yml
Normal file
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "socket_handler module utils - make sure this fully works when Docker SDK for Python is not available (https://github.com/ansible-collections/community.docker/pull/620)."
|
||||
@ -9,15 +9,11 @@ __metaclass__ = type
|
||||
import os
|
||||
import os.path
|
||||
import socket as pysocket
|
||||
import struct
|
||||
|
||||
from ansible.module_utils.six import PY2
|
||||
|
||||
try:
|
||||
from docker.utils import socket as docker_socket
|
||||
import struct
|
||||
except Exception:
|
||||
# missing Docker SDK for Python handled in ansible_collections.community.docker.plugins.module_utils.common
|
||||
pass
|
||||
from ansible_collections.community.docker.plugins.module_utils._api.utils import socket as docker_socket
|
||||
|
||||
from ansible_collections.community.docker.plugins.module_utils.socket_helper import (
|
||||
make_unblocking,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user