From d6a187671ca7383643169feb8c9b4d8c895a8231 Mon Sep 17 00:00:00 2001 From: Shane Canon Date: Thu, 10 Mar 2022 16:47:15 -0800 Subject: [PATCH] Handle more auth responses --- imagegw/shifter_imagegw/dockerv2_ext.py | 3 +++ 1 file changed, 3 insertions(+) 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"))