From b10bd92fc39633dbfffba2e5bd5c4630baf880e6 Mon Sep 17 00:00:00 2001 From: Miroslav Los Date: Wed, 18 Dec 2019 18:28:59 +0100 Subject: Address k8s plugin code smells reported by sonar Make 'resources' argument to k8sclient.k8sclient.deploy an optional kwarg, update its uses and document it. Split off code reported complex from deploy into functions. Tweak a nested if in tasks. Signed-off-by: Miroslav Los Issue-ID: DCAEGEN2-2006 Change-Id: I13a091de9207bab1c7d4eee3179263c5d994ffbf --- k8s/tests/common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'k8s/tests') diff --git a/k8s/tests/common.py b/k8s/tests/common.py index 67f70a6..c696f41 100644 --- a/k8s/tests/common.py +++ b/k8s/tests/common.py @@ -2,6 +2,7 @@ # org.onap.dcae # ================================================================================ # Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2020 Pantheon.tech. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -121,15 +122,15 @@ def do_deploy(tls_info=None): k8s_test_config = _set_k8s_configuration() - resources = _set_resources() - kwargs = _set_common_kwargs() + kwargs['resources'] = _set_resources() + if tls_info: kwargs["tls_info"] = tls_info - dep, deployment_description = k8sclient.k8sclient.deploy("k8stest","testcomponent","example.com/testcomponent:1.4.3",1,False, k8s_test_config, resources, **kwargs) + dep, deployment_description = k8sclient.k8sclient.deploy("k8stest", "testcomponent", "example.com/testcomponent:1.4.3", 1, False, k8s_test_config, **kwargs) # Make sure all of the basic k8s parameters are correct verify_common(dep, deployment_description) - return dep, deployment_description \ No newline at end of file + return dep, deployment_description -- cgit 1.2.3-korg