Loading src/_dns.py +6 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ def validate_soa(): try: r = soas.pop() r.mname.to_text() except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "SOA record is invalid."] return [True, "SOA record validated."] Loading @@ -58,7 +59,8 @@ def validate_mx(): ips = cross_query(r.exchange.to_text()) if len(ips) > 1: return [False, "MX records don't match."] except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "MX record is invalid."] return [True, "MX record validated."] Loading @@ -71,7 +73,8 @@ def validate_subdomains(): ips = cross_query(d) if len(ips) > 1: return [True, f"Domain {d} records don't match."] except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "Failed to validate domain {d}."] return [True, "Subdomains validated."] Loading src/utils.py +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ def check_url(url, method="GET", valid_codes=(200)): try: response = requests.request(method, url, allow_redirects=False) return response.status_code in valid_codes except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except,invalid-name print(str(e)) return False Loading Loading
src/_dns.py +6 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ def validate_soa(): try: r = soas.pop() r.mname.to_text() except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "SOA record is invalid."] return [True, "SOA record validated."] Loading @@ -58,7 +59,8 @@ def validate_mx(): ips = cross_query(r.exchange.to_text()) if len(ips) > 1: return [False, "MX records don't match."] except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "MX record is invalid."] return [True, "MX record validated."] Loading @@ -71,7 +73,8 @@ def validate_subdomains(): ips = cross_query(d) if len(ips) > 1: return [True, f"Domain {d} records don't match."] except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except print(str(e)) return [False, "Failed to validate domain {d}."] return [True, "Subdomains validated."] Loading
src/utils.py +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ def check_url(url, method="GET", valid_codes=(200)): try: response = requests.request(method, url, allow_redirects=False) return response.status_code in valid_codes except Exception: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except,invalid-name print(str(e)) return False Loading