From: stevenvanrossem Date: Thu, 9 Feb 2017 12:54:42 +0000 (+0100) Subject: imporved son-monitor container startup and timeout X-Git-Tag: v3.1~45^2~3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=a7f601c1121f467de22cd024d543672980533a2d;p=osm%2Fvim-emu.git imporved son-monitor container startup and timeout --- 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