From 82d1584e59eb27cca7d9e247e05069eed44d6463 Mon Sep 17 00:00:00 2001
From: Federico Ressi <fressi@redhat.com>
Date: Wed, 8 May 2019 16:07:15 +0200
Subject: [PATCH] Fix ping when no stdout is given

Change-Id: I0cf1c52f16fb7630cbba3be057fa90867e8b7356
---
 tobiko/shell/ping/_ping.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tobiko/shell/ping/_ping.py b/tobiko/shell/ping/_ping.py
index 9cabb5ea9..8f4d5e635 100644
--- a/tobiko/shell/ping/_ping.py
+++ b/tobiko/shell/ping/_ping.py
@@ -183,10 +183,11 @@ def iter_statistics(parameters=None, ssh_client=None, until=None, check=True,
             pass
 
         else:
-            if result.exit_status is not None:
+            if result.exit_status is not None and result.stdout:
                 statistics = _statistics.parse_ping_statistics(
                     output=result.stdout, begin_interval=now,
                     end_interval=time.time())
+
                 yield statistics
 
                 transmitted += statistics.transmitted