Skip to content

Commit

Permalink
Fix: Make explicit/implicit returns consistent
Browse files Browse the repository at this point in the history
The check_command_status function will now always explicitly return
False unless the check succeeds while the non-None return from
_ssh_authentication_input_loop has been removed.
  • Loading branch information
timopollmeier authored and greenbonebot committed Dec 19, 2023
1 parent 802ec6c commit 87090ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gvm/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _ssh_authentication_input_loop(
save = input()
break
elif add == "no":
return sys.exit(
sys.exit(
"User denied key. Host key verification failed."
)
else:
Expand Down
3 changes: 3 additions & 0 deletions gvm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ def check_command_status(xml: str) -> bool:
except KeyError:
print(logger)
logger.error("Not received an status code within the response.")
return False
except etree.Error as e:
logger.error("etree.XML(xml): %s", e)
return False

return False


def to_dotted_types_dict(types: List) -> TypesDict:
"""Create a dictionary accessible via dot notation"""
Expand Down

0 comments on commit 87090ca

Please sign in to comment.