From d6875626088d1e664976805bd7b321f4fbc48f1f Mon Sep 17 00:00:00 2001 From: Elia El Lazkani Date: Sat, 9 Mar 2019 22:18:58 -0500 Subject: [PATCH] Fixing PEP8 issues --- get-k8s-resources.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/get-k8s-resources.py b/get-k8s-resources.py index e082ded..da5812a 100644 --- a/get-k8s-resources.py +++ b/get-k8s-resources.py @@ -77,7 +77,7 @@ def get_ingresses(api, namespace): def json_dump(object_list): return json.dumps(object_list) - + def print_list(k8s_object_list): _k8s_object_list = [] for k8s_object in k8s_object_list.items: @@ -105,22 +105,10 @@ def get_client(kubeconfig, context): k8s_types = { - "deployments": { - "function": get_deployments, - "api": get_extensions - }, - "services": { - "function": get_services, - "api": get_core_api_v1 - }, - "pods": { - "function": get_pods, - "api": get_core_api_v1 - }, - "ingresses": { - "function": get_ingresses, - "api": get_extensions - } + "deployments": {"function": get_deployments, "api": get_extensions}, + "services": {"function": get_services, "api": get_core_api_v1}, + "pods": {"function": get_pods, "api": get_core_api_v1}, + "ingresses": {"function": get_ingresses, "api": get_extensions}, } @@ -130,7 +118,9 @@ def main(): api = None if parser.type in k8s_types.keys(): api = k8s_types[parser.type]["api"](_client) - k8s_object_list = k8s_types[parser.type]["function"](api, parser.namespace) + k8s_object_list = k8s_types[parser.type]["function"]( + api, parser.namespace + ) print_list(k8s_object_list)