From 1aef17a4ff33e46fb7dad598c7c4120ee6f58280 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Fri, 11 Jan 2019 17:07:26 +0100 Subject: [PATCH] podman: only check image availability when inspecting image When a paunch command (e.g. 'paunch list') requires inspection of a container, it passes the container id to inspect, so we cannot check for image availability at this time (we probably don't need to anyway because the container exists). Only check for image availability if the inspect function is requested to inspect an image. Change-Id: I8491eddaae172c8cf0b386d4731ab72dc113049c --- paunch/runner.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/paunch/runner.py b/paunch/runner.py index 6e60b9b..d0f0765 100644 --- a/paunch/runner.py +++ b/paunch/runner.py @@ -94,11 +94,13 @@ class BaseRunner(object): def inspect(self, name, output_format=None, o_type='container', quiet=False): - img_exist = self.image_exist(name) - # We want to verify if the image exists before inspecting it. + # If we're being asked to inspect a container image, we + # want to verify that the image exists before inspecting it. # Context: https://github.com/containers/libpod/issues/1845 - if img_exist != 0: - return + if o_type == 'image': + img_exist = self.image_exist(name) + if img_exist != 0: + return cmd = [self.cont_cmd, 'inspect', '--type', o_type] if output_format: cmd.append('--format')