From 2eddc12be70c98bc9d79afd6b8effef0e4ebfe15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Andr=C3=A9?= <m.andre@redhat.com>
Date: Tue, 11 Apr 2017 09:29:52 +0200
Subject: [PATCH] Do not log errors on non-existing container

This is cluttering up the logs with useless error messages, making it
more difficult than necessary to debug the CI job.

Change-Id: Icbdc4c74d99fea39b8722955dab56e5f538849aa
---
 docker/docker-puppet.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py
index c364d039be..9a8e9211d6 100755
--- a/docker/docker-puppet.py
+++ b/docker/docker-puppet.py
@@ -61,7 +61,10 @@ def rm_container(name):
                                stderr=subprocess.PIPE)
     cmd_stdout, cmd_stderr = subproc.communicate()
     print(cmd_stdout)
-    print(cmd_stderr)
+    if cmd_stderr and \
+            cmd_stderr != 'Error response from daemon: ' \
+            'No such container: {}\n'.format(name):
+        print(cmd_stderr)
 
 process_count = int(os.environ.get('PROCESS_COUNT',
                                    multiprocessing.cpu_count()))