From d513aa7b1e8ef9e19c829fb8a2dd8adccc6a39a4 Mon Sep 17 00:00:00 2001 From: Daniel Sagi Date: Sat, 22 Jan 2022 15:51:18 +0200 Subject: [PATCH] fixed linting issues --- kube_hunter/modules/discovery/hosts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kube_hunter/modules/discovery/hosts.py b/kube_hunter/modules/discovery/hosts.py index bc7f13c..760211e 100644 --- a/kube_hunter/modules/discovery/hosts.py +++ b/kube_hunter/modules/discovery/hosts.py @@ -166,8 +166,8 @@ class FromPodHostDiscovery(Discovery): return True except requests.exceptions.ConnectionError: logger.debug("Failed to connect AWS metadata server v1") - except: - logger.debug(f"Unknown error when trying to connect to AWS metadata v1 API") + except Exception: + logger.debug("Unknown error when trying to connect to AWS metadata v1 API") return False def is_aws_pod_v2(self): @@ -191,8 +191,8 @@ class FromPodHostDiscovery(Discovery): return True except requests.exceptions.ConnectionError: logger.debug("Failed to connect AWS metadata server v2") - except: - logger.debug(f"Unknown error when trying to connect to AWS metadata v2 API") + except Exception: + logger.debug("Unknown error when trying to connect to AWS metadata v2 API") return False def is_azure_pod(self): @@ -210,8 +210,8 @@ class FromPodHostDiscovery(Discovery): return True except requests.exceptions.ConnectionError: logger.debug("Failed to connect Azure metadata server") - except: - logger.debug(f"Unknown error when trying to connect to Azure metadata server") + except Exception: + logger.debug("Unknown error when trying to connect to Azure metadata server") return False # for pod scanning