Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Commit 0bffaf6

Browse files
giusepperh-atomic-bot
authored andcommitted
mount: fail if image cannot be mounted from OSTree
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1127 Approved by: ashcrow
1 parent 983a864 commit 0bffaf6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Atomic/mount.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,11 @@ def mount(self, best_mountpoint_for_storage=False):
196196

197197
elif self.storage.lower() == "ostree":
198198
try:
199-
if self._try_ostree_mount(best_mountpoint_for_storage):
200-
return
199+
res = self._try_ostree_mount(best_mountpoint_for_storage)
200+
# If ostree storage was explicitely requested, then we have to
201+
# error out if the container/image could not be mounted.
202+
if res == False:
203+
raise ValueError("Could not mount {}".format(self.image))
201204
except GLib.Error: # pylint: disable=catching-non-exception
202205
self._no_such_image()
203206

0 commit comments

Comments
 (0)