Commit 88a61279 authored by hackhard's avatar hackhard
Browse files

Corrected the status code logic (Pipeline Error)

parent c323b0ec
Pipeline #9599 passed with stage
in 2 minutes and 27 seconds
......@@ -436,11 +436,10 @@ class Analyzer:
# pylint: disable=C0206
for i in tor_HAR:
if tor_HAR[i] != 0 or tor_HAR != "" or tor_HAR is not None:
if(300 <= tor_HAR[i] < 400):
if 300 <= tor_HAR[i] < 400:
continue
else:
self.tor_store[i] = tor_HAR[i] # type: ignore
break
self.tor_store[i] = tor_HAR[i] # type: ignore
break
for i in range(len(non_tor_http_requests["log"]["entries"])):
non_tor_HAR[
......@@ -450,11 +449,10 @@ class Analyzer:
# pylint: disable=C0206
for i in non_tor_HAR:
if non_tor_HAR[i] != 0 or non_tor_HAR != "" or non_tor_HAR is not None:
if(300 <= non_tor_HAR[i] < 400):
if 300 <= non_tor_HAR[i] < 400:
continue
else:
self.non_store[i] = non_tor_HAR[i] # type: ignore
break
self.non_store[i] = non_tor_HAR[i] # type: ignore
break
first_url_t = list(self.tor_store.keys())[0]
first_status_tor = int(self.tor_store[str(first_url_t)])
......@@ -463,7 +461,11 @@ class Analyzer:
first_url_nt = list(self.non_store.keys())[0]
first_status_non_tor = int(self.non_store[str(first_url_nt)])
self.__logger.info("Tor status: %d and Nontor status: %d",first_status_tor,first_status_non_tor)
self.__logger.info(
"Tor status: %d and Nontor status: %d",
first_status_tor,
first_status_non_tor,
)
if first_status_tor > 399 and first_status_non_tor < 400:
# Error for tag and no error for non tor
......@@ -497,4 +499,3 @@ class Analyzer:
self.__logger.debug(
"Check for the HARExport. Might have no entries and is out of indexes"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment