diff --git a/imagegw/shifter_imagegw/dockerv2_ext.py b/imagegw/shifter_imagegw/dockerv2_ext.py index 85269172..aa2ccb91 100644 --- a/imagegw/shifter_imagegw/dockerv2_ext.py +++ b/imagegw/shifter_imagegw/dockerv2_ext.py @@ -106,7 +106,10 @@ def _inspect(self): stdout, stderr = process.communicate() stderr_str = stderr.decode("utf-8") auth_errors = ['authentication', 'forbidden', 'unauthorized'] + # see if we got some type of unauthorized response if not any(a_err in stderr_str.lower() for a_err in auth_errors): + # See if it exited with an error + if process.returncode: raise OSError("Skopeo inspect failed: %s" % (stderr_str)) return json.loads(stdout.decode("utf-8"))