1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Promulgate house's fix for docker_volume to docker_secret

* Revert change to docker_common as it's not as good as the try: except fix
* limit docker_volume fix to ImportErrors
* fix docker_secret i nthe same way
* Remove docker_secret from import tests
This commit is contained in:
Toshio Kuratomi 2017-07-19 12:52:49 -07:00
parent ef8c9798d3
commit df15583ad0
4 changed files with 12 additions and 9 deletions

View file

@ -90,9 +90,6 @@ if not HAS_DOCKER_PY:
def __init__(self, **kwargs):
pass
class APIError:
def __init__(self, **kwargs):
pass
class DockerBaseClass(object):

View file

@ -145,8 +145,15 @@ secret_id:
'''
import hashlib
try:
from docker.errors import APIError
except ImportError:
# missing docker-py handled in ansible.module_utils.docker
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.docker_common import AnsibleDockerClient, DockerBaseClass, APIError
from ansible.module_utils.docker_common import AnsibleDockerClient, DockerBaseClass
from ansible.module_utils._text import to_native, to_bytes

View file

@ -106,15 +106,15 @@ facts:
sample: {}
'''
from ansible.module_utils.six import iteritems, text_type
from ansible.module_utils.docker_common import DockerBaseClass, AnsibleDockerClient
try:
from docker.errors import APIError
except:
except ImportError:
# missing docker-py handled in ansible.module_utils.docker
pass
from ansible.module_utils.six import iteritems, text_type
from ansible.module_utils.docker_common import DockerBaseClass, AnsibleDockerClient
class TaskParameters(DockerBaseClass):
def __init__(self, client):

View file

@ -41,7 +41,6 @@ lib/ansible/modules/cloud/cloudstack/cs_vpn_gateway.py
lib/ansible/modules/cloud/cloudstack/cs_zone.py
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py
lib/ansible/modules/cloud/docker/docker_secret.py
lib/ansible/modules/cloud/google/gc_storage.py
lib/ansible/modules/cloud/google/gcdns_record.py
lib/ansible/modules/cloud/google/gcdns_zone.py