From a7f601c1121f467de22cd024d543672980533a2d Mon Sep 17 00:00:00 2001 From: stevenvanrossem Date: Thu, 9 Feb 2017 13:54:42 +0100 Subject: [PATCH] imporved son-monitor container startup and timeout --- src/emuvim/dcemulator/monitoring.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/emuvim/dcemulator/monitoring.py b/src/emuvim/dcemulator/monitoring.py index d0e45da..de96e37 100755 --- a/src/emuvim/dcemulator/monitoring.py +++ b/src/emuvim/dcemulator/monitoring.py @@ -600,6 +600,17 @@ class DCNetworkMonitor(): labels=['com.containernet'], name='skewmon' ) + # Wait a while for containers to be completely started + started = False + wait_time = 0 + while not started: + list1 = self.dockercli.containers.list(filters={'status': 'running', 'name': 'prometheus'}) + if len(list1) >= 1: + started = True + if wait_time > 5: + return 'skewmon not started' + time.sleep(1) + wait_time += 1 return ret -- 2.25.1