From a32354fd91551bd0d10ee14cb1bfad7d70ebae66 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Sat, 23 Dec 2023 05:51:45 -0800 Subject: [PATCH] Fixed PLR5501 (collapsible-else-if): Use `elif` instead of `else` then `if`, to reduce indentation --- management/status_checks.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/management/status_checks.py b/management/status_checks.py index 831a7510..0f060100 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -154,12 +154,11 @@ def check_service(i, service, env): if not running and service["port"] in {80, 443}: output.print_line(shell('check_output', ['nginx', '-t'], capture_stderr=True, trap=True)[1].strip()) + # Service should be running locally. + elif try_connect("127.0.0.1"): + running = True else: - # Service should be running locally. - if try_connect("127.0.0.1"): - running = True - else: - output.print_error("%s is not running (port %d)." % (service['name'], service['port'])) + output.print_error("%s is not running (port %d)." % (service['name'], service['port'])) # Flag if local DNS is not running. if not running and service["port"] == 53 and service["public"] is False: