aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-03-05 12:36:00 +0100
committerMarco Platania <platania@research.att.com>2020-03-05 15:26:55 +0000
commit37fe1c2e88838760a733fbf1129067685ad7a6ea (patch)
tree40eef9402c168dfe78afc0f47889024543b60e80 /test
parent4be94a653e2bff518682f10fce2b5e2b9eeb7ed6 (diff)
Fix linting issues in check_for_ingress_and_nodeports.py
Change-Id: Ic0d2a32a964a4cf5ff1580ffd06103c450a0e8b0 Issue-ID: INT-1427 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/security/check_for_ingress_and_nodeports.py12
1 files changed, 6 insertions, 6 deletions
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 '