diff mbox series

[for,3.0,03/10] docker: fail more gracefully on docker.py check

Message ID 20180709152117.21585-4-alex.bennee@linaro.org
State Superseded
Headers show
Series various docker fixes | expand

Commit Message

Alex Bennée July 9, 2018, 3:21 p.m. UTC
As this is called directly from the Makefile while determining
dependencies and it is possible the user was configured in one window
but not have credentials in the other. Let's catch the Exceptions and
deal with it quietly.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reported-by: Peter Maydell <peter.maydell@linaro.org>
---
 tests/docker/docker.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.17.1

Comments

Philippe Mathieu-Daudé July 10, 2018, 8:44 p.m. UTC | #1
On 07/09/2018 12:21 PM, Alex Bennée wrote:
> As this is called directly from the Makefile while determining

> dependencies and it is possible the user was configured in one window

> but not have credentials in the other. Let's catch the Exceptions and

> deal with it quietly.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> Reported-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> ---

>  tests/docker/docker.py | 7 ++++++-

>  1 file changed, 6 insertions(+), 1 deletion(-)

> 

> diff --git a/tests/docker/docker.py b/tests/docker/docker.py

> index 69e7130db7..2f81c6b13b 100755

> --- a/tests/docker/docker.py

> +++ b/tests/docker/docker.py

> @@ -479,7 +479,12 @@ class CheckCommand(SubCommand):

>      def run(self, args, argv):

>          tag = args.tag

>  

> -        dkr = Docker()

> +        try:

> +            dkr = Docker()

> +        except:

> +            print("Docker not set up")

> +            return 1

> +

>          info = dkr.inspect_tag(tag)

>          if info is None:

>              print("Image does not exist")

>
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 69e7130db7..2f81c6b13b 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -479,7 +479,12 @@  class CheckCommand(SubCommand):
     def run(self, args, argv):
         tag = args.tag
 
-        dkr = Docker()
+        try:
+            dkr = Docker()
+        except:
+            print("Docker not set up")
+            return 1
+
         info = dkr.inspect_tag(tag)
         if info is None:
             print("Image does not exist")