From 37fe1c2e88838760a733fbf1129067685ad7a6ea Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Thu, 5 Mar 2020 12:36:00 +0100 Subject: Fix linting issues in check_for_ingress_and_nodeports.py Change-Id: Ic0d2a32a964a4cf5ff1580ffd06103c450a0e8b0 Issue-ID: INT-1427 Signed-off-by: Bartek Grzybowski --- test/security/check_for_ingress_and_nodeports.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/security') diff --git a/test/security/check_for_ingress_and_nodeports.py b/test/security/check_for_ingress_and_nodeports.py index 27066bf00..f357234dc 100755 --- a/test/security/check_for_ingress_and_nodeports.py +++ b/test/security/check_for_ingress_and_nodeports.py @@ -49,13 +49,13 @@ import socket from enum import Enum import argparse import sys -from colorama import Fore, Back, Style +from colorama import Fore import urllib.parse from os import path """ List all nodeports """ def list_nodeports(v1): - ret = {}; + ret = {} svc = v1.list_namespaced_service(K8S_NAMESPACE) for i in svc.items: if i.spec.ports: @@ -116,7 +116,7 @@ def scan_single_port(host,port,scanmode): retstatus = False try: conn.request("GET","/") - outstr = conn.getresponse(); + outstr = conn.getresponse() except http.client.BadStatusLine as exc: outstr = "Non HTTP proto" + str(exc) retstatus = exc @@ -172,9 +172,9 @@ def scan_port(host, http, https, mode): # Visualise scan result def console_visualisation(cname, name, retstatus, httpcode, out, mode, httpcodes = None): - if httpcodes==None: httpcodes=[] - print(Fore.YELLOW,end=''); - print( cname,name, end='\t',sep='\t'); + if httpcodes is None: httpcodes=[] + print(Fore.YELLOW,end='') + print( cname,name, end='\t',sep='\t') if isinstance(retstatus,ScanMode): if httpcode in httpcodes: estr = Fore.RED + '[ERROR ' else: estr = Fore.GREEN + '[OK ' -- cgit 1.2.3-korg