aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2020-09-28 15:22:35 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-28 15:22:35 +0000
commitd73266541638d1034818d4806c34f68787bd373d (patch)
tree28da7ce5846aecb0eab2250deddef0c5482cb003 /src/onaptests/steps
parent94db6a31175c3a61bda3142cdb4913efea8d081c (diff)
parent5c0bd7d165c18aabe3234cbd605e50e71c9d1f50 (diff)
Merge "Wait for distribution before launching the instantiation"
Diffstat (limited to 'src/onaptests/steps')
-rw-r--r--src/onaptests/steps/instantiate/service_ala_carte.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/onaptests/steps/instantiate/service_ala_carte.py b/src/onaptests/steps/instantiate/service_ala_carte.py
index 84d8208..eb98f19 100644
--- a/src/onaptests/steps/instantiate/service_ala_carte.py
+++ b/src/onaptests/steps/instantiate/service_ala_carte.py
@@ -168,6 +168,30 @@ class YamlTemplateServiceAlaCarteInstantiateStep(YamlTemplateBaseStep):
self._logger.info("Owning entity not found, create it")
owning_entity = AaiOwningEntity.create(settings.OWNING_ENTITY)
vid_project = Project.create(settings.PROJECT)
+
+ # Before instantiating, be sure that the service has been distributed
+ self._logger.info("******** Check Service Distribution *******")
+ distribution_completed = False
+ nb_try = 0
+ nb_try_max = 10
+ while distribution_completed is False and nb_try < nb_try_max:
+ distribution_completed = service.distributed
+ if distribution_completed is True:
+ self._logger.info(
+ "Service Distribution for %s is sucessfully finished",
+ service.name)
+ break
+ self._logger.info(
+ "Service Distribution for %s ongoing, Wait for 60 s",
+ service.name)
+ time.sleep(60)
+ nb_try += 1
+
+ if distribution_completed is False:
+ self._logger.error(
+ "Service Distribution for %s failed !!",service.name)
+ exit(1)
+
service_instantiation = ServiceInstantiation.instantiate_so_ala_carte(
service,
cloud_region,