security: fix all bandit issues

This commit is contained in:
Iain Learmonth 2022-05-16 12:47:40 +01:00
parent c25367d95c
commit 014596d271
5 changed files with 31 additions and 13 deletions

View file

@ -42,5 +42,7 @@ def _get_alarm(target: str,
def get_proxy_alarm(proxy_id: int, alarm_type: str) -> Alarm:
alarm = _get_alarm("proxy", alarm_type, proxy_id=proxy_id)
assert(alarm is not None)
if alarm is None:
# mypy can't tell that this will never be reached
raise RuntimeError("Creating an alarm must have failed.")
return alarm