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

Fix docker error handling for cs/vcenter tests.

This commit is contained in:
Matt Clay 2017-09-15 16:08:25 -07:00
parent 61dd5517c3
commit 397918435b
2 changed files with 16 additions and 7 deletions

View file

@ -66,12 +66,18 @@ class CsCloudProvider(CloudProvider):
if os.path.isfile(self.config_static_path): if os.path.isfile(self.config_static_path):
return return
docker = find_executable('docker') docker = find_executable('docker', required=False)
if docker: if docker:
return return
super(CsCloudProvider, self).filter(targets, exclude) skip = 'cloud/%s/' % self.platform
skipped = [target.name for target in targets if skip in target.aliases]
if skipped:
exclude.append(skip)
display.warning('Excluding tests marked "%s" which require the "docker" command or config (see "%s"): %s'
% (skip.rstrip('/'), self.config_template_path, ', '.join(skipped)))
def setup(self): def setup(self):
"""Setup the cloud resource before delegation and register a cleanup callback.""" """Setup the cloud resource before delegation and register a cleanup callback."""

View file

@ -47,15 +47,18 @@ class VcenterProvider(CloudProvider):
:type targets: tuple[TestTarget] :type targets: tuple[TestTarget]
:type exclude: list[str] :type exclude: list[str]
""" """
if os.path.isfile(self.config_static_path): docker = find_executable('docker', required=False)
return
docker = find_executable('docker')
if docker: if docker:
return return
super(VcenterProvider, self).filter(targets, exclude) skip = 'cloud/%s/' % self.platform
skipped = [target.name for target in targets if skip in target.aliases]
if skipped:
exclude.append(skip)
display.warning('Excluding tests marked "%s" which require the "docker" command: %s'
% (skip.rstrip('/'), ', '.join(skipped)))
def setup(self): def setup(self):
"""Setup the cloud resource before delegation and register a cleanup callback.""" """Setup the cloud resource before delegation and register a cleanup callback."""