Skip to content

Commit

Permalink
fix: fixed _cached_hosts issue
Browse files Browse the repository at this point in the history
  • Loading branch information
payaljindal committed Jan 9, 2024
1 parent 4bf4115 commit 0131a34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/target-server-validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def main():
updated_batch = {'host_port': []}
host_ports = batch.get('host_port', [])
for host_port in host_ports:
if f"{host_port.get('host','')}:{host_port.get('port','')}" in _cached_hosts: # noqa
if f"{host_port.get('host','')} : {host_port.get('port','')}" in _cached_hosts: # noqa
status = _cached_hosts[f"{host_port.get('host','')} : {host_port.get('port','')}"] # noqa
final_report.append(
[
Expand All @@ -249,7 +249,7 @@ def main():
else:
outputs = response.get("hostname_portnumbers_status", [])
for output in outputs:
_cached_hosts[f'{output["host"]}:{output["port"]}'] = output["status"] # noqa
_cached_hosts[f'{output["host"]} : {output["port"]}'] = output["status"] # noqa
final_report.append(
[
output["name"],
Expand Down
2 changes: 1 addition & 1 deletion tools/target-server-validator/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run_validator_proxy(
if response.status_code == 200:
return response.json()
else:
return {"error": f"An error occurred: {response.text}"}
return {"error": f"An error occurred: {response.json().get('error','')}"} # noqa
except Exception as e:
return {"error": f"An error occurred: {e}"}

Expand Down

0 comments on commit 0131a34

Please sign in to comment.