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/onboard | |
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/onboard')
-rw-r--r-- | src/onaptests/steps/onboard/clamp.py | 1 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/msb_k8s.py | 9 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/service.py | 9 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/vsp.py | 8 |
4 files changed, 17 insertions, 10 deletions
diff --git a/src/onaptests/steps/onboard/clamp.py b/src/onaptests/steps/onboard/clamp.py index 72daba2..c8984ba 100644 --- a/src/onaptests/steps/onboard/clamp.py +++ b/src/onaptests/steps/onboard/clamp.py @@ -10,6 +10,7 @@ from onapsdk.configuration import settings from ..base import YamlTemplateBaseStep from .service import YamlTemplateVfOnboardStep + class OnboardClampStep(YamlTemplateBaseStep): """Onboard class to create CLAMP templates.""" diff --git a/src/onaptests/steps/onboard/msb_k8s.py b/src/onaptests/steps/onboard/msb_k8s.py index 3605c29..666de33 100644 --- a/src/onaptests/steps/onboard/msb_k8s.py +++ b/src/onaptests/steps/onboard/msb_k8s.py @@ -69,11 +69,12 @@ class CreateProfileStep(BaseStep): def execute(self) -> None: """Create profile.""" super().execute() - definition: Definition = Definition.get_definition_by_name_version(\ + definition: Definition = Definition.get_definition_by_name_version( rb_name=settings.MSB_K8S_RB_NAME, rb_version=settings.MSB_K8S_RB_VERSION) with open(settings.MSB_K8S_PROFILE_ARTIFACT_FILE_PATH, "rb") as profile_file: - self.profile = definition.create_profile(profile_name=settings.MSB_K8S_PROFILE_NAME, - namespace=settings.K8S_ADDITIONAL_RESOURCES_NAMESPACE, - kubernetes_version=settings.K8S_VERSION) + self.profile = definition.create_profile( + profile_name=settings.MSB_K8S_PROFILE_NAME, + namespace=settings.K8S_ADDITIONAL_RESOURCES_NAMESPACE, + kubernetes_version=settings.K8S_VERSION) self.profile.upload_artifact(profile_file.read()) diff --git a/src/onaptests/steps/onboard/service.py b/src/onaptests/steps/onboard/service.py index b1e7d4d..c0bec0d 100644 --- a/src/onaptests/steps/onboard/service.py +++ b/src/onaptests/steps/onboard/service.py @@ -55,7 +55,8 @@ class ServiceOnboardStep(BaseStep): """ super().execute() - service: Service = Service(name=settings.SERVICE_NAME, instantiation_type=settings.SERVICE_INSTANTIATION_TYPE) + service: Service = Service(name=settings.SERVICE_NAME, + instantiation_type=settings.SERVICE_INSTANTIATION_TYPE) if not service.created(): service.create() if settings.VL_NAME != "": @@ -70,7 +71,8 @@ class ServiceOnboardStep(BaseStep): # If the service is already distributed, do not try to checkin/onboard (replay of tests) # checkin is done if needed # If service is replayed, no need to try to re-onboard the model - # Double check because of: https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/176 + # Double check because of: + # https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/176 if not service.distributed and service.status != onapsdk_const.DISTRIBUTED: if service.status == onapsdk_const.DRAFT: try: @@ -186,7 +188,8 @@ class YamlTemplateServiceOnboardStep(YamlTemplateBaseStep): # If the service is already distributed, do not try to checkin/onboard (replay of tests) # checkin is done if needed # If service is replayed, no need to try to re-onboard the model - # Double check because of: https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/176 + # Double check because of: + # https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/176 if not service.distributed and service.status != onapsdk_const.DISTRIBUTED: if service.status == onapsdk_const.DRAFT: try: diff --git a/src/onaptests/steps/onboard/vsp.py b/src/onaptests/steps/onboard/vsp.py index 49b766b..577b1cf 100644 --- a/src/onaptests/steps/onboard/vsp.py +++ b/src/onaptests/steps/onboard/vsp.py @@ -41,7 +41,9 @@ class VspOnboardStep(BaseStep): """ super().execute() vendor: Vendor = Vendor(name=settings.VENDOR_NAME) - vsp: Vsp = Vsp(name=settings.VSP_NAME, vendor=vendor, package=open(settings.VSP_FILE_PATH, "rb")) + vsp: Vsp = Vsp(name=settings.VSP_NAME, + vendor=vendor, + package=open(settings.VSP_FILE_PATH, "rb")) vsp.onboard() @BaseStep.store_state(cleanup=True) @@ -123,8 +125,8 @@ class YamlTemplateVspOnboardStep(YamlTemplateBaseStep): if "heat_files_to_upload" in pnf: with open(get_resource_location(pnf["heat_files_to_upload"]), "rb") as package: vsp: Vsp = Vsp(name=f"{pnf['pnf_name']}_VSP", - vendor=vendor, - package=package) + vendor=vendor, + package=package) vsp.onboard() @YamlTemplateBaseStep.store_state(cleanup=True) |