Skip to content

Commit 87090ca

Browse files
timopollmeiergreenbonebot
authored andcommitted
Fix: Make explicit/implicit returns consistent
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.
1 parent 802ec6c commit 87090ca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: gvm/connections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def _ssh_authentication_input_loop(
313313
save = input()
314314
break
315315
elif add == "no":
316-
return sys.exit(
316+
sys.exit(
317317
"User denied key. Host key verification failed."
318318
)
319319
else:

Diff for: gvm/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ def check_command_status(xml: str) -> bool:
6666
except KeyError:
6767
print(logger)
6868
logger.error("Not received an status code within the response.")
69+
return False
6970
except etree.Error as e:
7071
logger.error("etree.XML(xml): %s", e)
7172
return False
7273

74+
return False
75+
7376

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

0 commit comments

Comments
 (0)