diff --git a/pyproject.toml b/pyproject.toml index 874b9d6..786aed7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sophosfirewall-python" -version = "0.1.12" +version = "0.1.13" description = "Python SDK for Sophos Firewall" authors = ["Matt Mullen "] readme = "README.md" diff --git a/sophosfirewall_python/firewallapi.py b/sophosfirewall_python/firewallapi.py index 98198e1..fb7fee9 100644 --- a/sophosfirewall_python/firewallapi.py +++ b/sophosfirewall_python/firewallapi.py @@ -110,7 +110,12 @@ def _post(self, xmldata: str) -> requests.Response: resp_dict = xmltodict.parse(resp.content.decode())['Response'] if "Status" in resp_dict: if resp_dict["Status"]["@code"] == "534": - raise SophosFirewallAPIError("API operations are not allowed from the requester IP address") + # IP not allowed in API Access List + raise SophosFirewallAPIError(resp_dict["Status"]["#text"]) + + if resp_dict["Status"]["@code"] == "532": + # API access not enabled + raise SophosFirewallAPIError(resp_dict["Status"]["#text"]) if "Login" in resp_dict: if resp_dict["Login"]["status"] == "Authentication Failure":