From 23239f774220b70cab5455d0847a54dc27468c7c Mon Sep 17 00:00:00 2001 From: Ian Glen Neal Date: Thu, 11 Jan 2018 21:27:43 +0000 Subject: [PATCH] Fix #5465 by catching a no-image exception in get_container_data_volumes. The ImageNotFound exception is now bubbled up to the client, which prompts the user on the desired course of action (rebuild or abort). Added a case to the unit test to check that an empty existing image doesn't result in an exception. Closed old pull request #5466 because I did a rebase and it showed over 300 commits to merge, which I thought was messy. Signed-off-by: Ian Glen Neal --- compose/service.py | 4 ---- tests/unit/config/interpolation_test.py | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/compose/service.py b/compose/service.py index 7a59f0913db..d5e8e37c978 100644 --- a/compose/service.py +++ b/compose/service.py @@ -793,11 +793,7 @@ def _get_container_create_options( override_options.get('labels')) container_options, override_options = self._build_container_volume_options( -<<<<<<< 31ed61f8884fe526d21cce79f75c6a8d7ed2dcc5 - previous_container, container_options, override_options -======= previous_container, container_options, override_options, rebuild ->>>>>>> Fix #5465 by catching a no-image exception in ) container_options['image'] = self.image_name diff --git a/tests/unit/config/interpolation_test.py b/tests/unit/config/interpolation_test.py index 62f4ac774f1..eb27ee9fc46 100644 --- a/tests/unit/config/interpolation_test.py +++ b/tests/unit/config/interpolation_test.py @@ -1,5 +1,6 @@ # encoding: utf-8 + from __future__ import absolute_import from __future__ import unicode_literals