Skip to content

Commit

Permalink
[FAB-5028] Fix abort on docker cleanup failure
Browse files Browse the repository at this point in the history
In some cases, behave tests in fabric/test/feature aborts when
decomposing the test environment because "docker inspect" is executed
for a docker that is listed by "docker ps" but already deleted by
"docker-compose down". This patch avoids it.

Change-Id: I4806d1590c591b3e2304cc9e03d593007c09a261
Signed-off-by: Jun Nemoto <[email protected]>
  • Loading branch information
Jun Nemoto committed Jun 28, 2017
1 parent dc7c40b commit 3909cb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/feature/steps/compose_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ def rebuildContainerData(self):
self.containerDataList = []
for containerID in self.refreshContainerIDs():
# get container metadata
container = json.loads(str(subprocess.check_output(["docker", "inspect", containerID])))[0]
cmd = ["docker", "inspect", containerID]
try:
output = subprocess.check_output(cmd)
except:
err = "Error occurred {0}: {1}".format(cmd, sys.exc_info()[1])
continue
container = json.loads(str(output))[0]
# container name
container_name = container['Name'][1:]
# container ip address (only if container is running)
Expand Down

0 comments on commit 3909cb7

Please sign in to comment.