Make sure plugins/module_utils/socket_handler.py works when Docker SDK for Python is not installed. (#620)

This commit is contained in:
Felix Fontein 2023-05-15 21:43:31 +02:00 committed by GitHub
parent 7bdb2127e0
commit d7f7e44b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View 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)."

View File

@ -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,