Skip to content

Commit

Permalink
Add retries while checking for contrail-status
Browse files Browse the repository at this point in the history
Change-Id: Ibf9e6ff3155bc0d9c12c0915ae24d1ed72d00776
Closes-Bug: 1735880
(cherry picked from commit 6d8c38e)
  • Loading branch information
Senthilnathan Murugappan committed Dec 5, 2017
1 parent f6401c2 commit d88b176
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/contrail_test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from fabric.contrib.files import exists

from tcutils.util import *
from tcutils.util import custom_dict, read_config_option, get_build_sku
from tcutils.util import custom_dict, read_config_option, get_build_sku, retry
from tcutils.custom_filehandler import *
from tcutils.config.vnc_introspect_utils import VNCApiInspect
from tcutils.collector.opserver_introspect_utils import VerificationOpsSrv
Expand Down Expand Up @@ -1197,6 +1197,7 @@ def get_service_status(self, m, service):
return cls
return None

@retry(tries=6, delay=5)
def verify_service_state(self, host, service=None, role=None, container=None):
result = True
failed_services = []
Expand All @@ -1218,7 +1219,7 @@ def verify_service_state(self, host, service=None, role=None, container=None):
self.logger.error("Unable to get service status of %s on %s"
%(service, host))
self.logger.exception("Got exception as %s" % (e))
return False
return False, failed_services
return result, failed_services

# Commenting below 4 lines due to discovery changes in R4.0 - Bug 1658035
Expand Down

0 comments on commit d88b176

Please sign in to comment.