diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2023-07-17 13:30:55 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2023-07-17 13:50:59 +0000 |
commit | 939f1933c8635a18de428c696c97cc5d8600abff (patch) | |
tree | a58cb9342f1a9d2cec80fc6a792eae0daae7bc49 /src/onaptests/steps/instantiate/k8s_profile_create.py | |
parent | b1e1a5fa99e29b3ffc2bc48d11b163e28cbb7744 (diff) |
Add pylama into checks
Checks code with pylama
Issue-ID: INT-2222
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: If275ef90f21e3049abe72bcf373473b40846005c
Diffstat (limited to 'src/onaptests/steps/instantiate/k8s_profile_create.py')
-rw-r--r-- | src/onaptests/steps/instantiate/k8s_profile_create.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/onaptests/steps/instantiate/k8s_profile_create.py b/src/onaptests/steps/instantiate/k8s_profile_create.py index f0ad61b..27831c5 100644 --- a/src/onaptests/steps/instantiate/k8s_profile_create.py +++ b/src/onaptests/steps/instantiate/k8s_profile_create.py @@ -12,6 +12,7 @@ import onaptests.utils.exceptions as onap_test_exceptions from ..base import BaseStep from .vnf_ala_carte import YamlTemplateVnfAlaCarteInstantiateStep + class K8SProfileStep(BaseStep): """CreateK8sProfileStep.""" @@ -116,8 +117,10 @@ class K8SProfileStep(BaseStep): self._logger.info("Create the k8s profile if it doesn't exist") super().execute() customer: Customer = Customer.get_by_global_customer_id(settings.GLOBAL_CUSTOMER_ID) - service_subscription: ServiceSubscription = customer.get_service_subscription_by_service_type(self.service_name) - self._service_instance: ServiceInstance = service_subscription.get_service_instance_by_name(self.service_instance_name) + service_subscription: ServiceSubscription = \ + customer.get_service_subscription_by_service_type(self.service_name) + self._service_instance: ServiceInstance = \ + service_subscription.get_service_instance_by_name(self.service_instance_name) for vnf_instance in self._service_instance.vnf_instances: # possible to have several modules for 1 VNF @@ -140,15 +143,15 @@ class K8SProfileStep(BaseStep): self._logger.error("Missing rb profile information") raise onap_test_exceptions.ProfileInformationException - ######## Check profile for Definition ################################### + # Check profile for Definition try: rbdef.get_profile_by_name(k8s_profile_name) except ResourceNotFound: - ######## Create profile for Definition ################################### + # Create profile for Definition profile = rbdef.create_profile(k8s_profile_name, k8s_profile_namespace, settings.K8S_PROFILE_K8S_VERSION) - ####### Upload artifact for created profile ############################## + # Upload artifact for created profile profile.upload_artifact(open(settings.K8S_PROFILE_ARTIFACT_PATH, 'rb').read()) @BaseStep.store_state(cleanup=True) @@ -172,7 +175,7 @@ class K8SProfileStep(BaseStep): if k8s_profile_name == "": self._logger.error("K8s profile deletion failed, missing rb profile name") raise onap_test_exceptions.ProfileInformationException - ######## Delete profile for Definition ################################### + # Delete profile for Definition try: profile = rbdef.get_profile_by_name(k8s_profile_name) profile.delete() |