diff options
author | 2021-08-25 17:44:25 +0200 | |
---|---|---|
committer | 2021-08-25 17:46:39 +0200 | |
commit | 58a82a7e0a5bc010236991061aa959e55672028c (patch) | |
tree | aa647c89633301d1fcbe1a704715d346707e5c77 /src/onaptests/steps/instantiate/msb_k8s.py | |
parent | 5c91aa8f3286c685a88b03a073865f2e0caf9f2a (diff) |
[TEST] Unwind master back to 27.07.2020
Unwind master due to regression in few tests.
Issue-ID: OOM-1
Change-Id: I3b759a5928aeb47fc7fddeaa5998aa090d085c5c
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'src/onaptests/steps/instantiate/msb_k8s.py')
-rw-r--r-- | src/onaptests/steps/instantiate/msb_k8s.py | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/src/onaptests/steps/instantiate/msb_k8s.py b/src/onaptests/steps/instantiate/msb_k8s.py index ba1b732..e6186f5 100644 --- a/src/onaptests/steps/instantiate/msb_k8s.py +++ b/src/onaptests/steps/instantiate/msb_k8s.py @@ -1,6 +1,4 @@ """MSB k8s instantiation module.""" -import time - from onapsdk.configuration import settings from onapsdk.msb.k8s import Instance @@ -8,35 +6,6 @@ from onaptests.steps.base import BaseStep from onaptests.steps.onboard.msb_k8s import CreateProfileStep -class InstancesCleanup(BaseStep): - """Delete old instances which were not cleaned up properly.""" - - @property - def description(self) -> str: - """Step description.""" - return ("Delete old instances which were created using same MSB_K8S_RESOURCE_NAME_PREFIX" - " and were not cleaned up.") - - @property - def component(self) -> str: - """Component name.""" - return "K8S plugin" - - @BaseStep.store_state - def execute(self) -> None: - """Create instance using MSB K8S plugin.""" - super().execute() - self._logger.debug("Delete all instances which are created using definition with same prefix ") - any_deleted: bool = False - for instance in Instance.get_all(): - if instance.request.profile_name.startswith(settings.MSB_K8S_RESOURCE_NAME_PREFIX): - self._logger.debug("Delete %s instance", instance.instance_id) - instance.delete() - any_deleted = True - if any_deleted: - time.sleep(settings.MSB_K8S_CLEANUP_WAIT_TIME) # Give it some time to delete k8s resources (pods, services, deployments...) - - class CreateInstanceStep(BaseStep): """Create MSB k8s instance step.""" @@ -47,7 +16,6 @@ class CreateInstanceStep(BaseStep): - CreateProfileStep. """ super().__init__(cleanup=cleanup) - self.add_step(InstancesCleanup()) self.add_step(CreateProfileStep(cleanup=cleanup)) self.instance: Instance = None @@ -66,9 +34,9 @@ class CreateInstanceStep(BaseStep): """Create instance using MSB K8S plugin.""" super().execute() self.instance = Instance.create(cloud_region_id=settings.CLOUD_REGION_ID, - profile_name=settings.MSB_K8S_PROFILE_NAME, - rb_name=settings.MSB_K8S_RB_NAME, - rb_version=settings.MSB_K8S_RB_VERSION) + profile_name=settings.PNF_PROFILE_NAME, + rb_name=settings.PNF_RB_NAME, + rb_version=settings.PNF_RB_VERSION) @BaseStep.store_state(cleanup=True) def cleanup(self) -> None: |