fix(openstack): move exception codes off the Alibaba Cloud range (#11382)

This commit is contained in:
Hugo Pereira Brito
2026-05-28 11:52:45 +02:00
committed by GitHub
parent c58dad2ca4
commit edbbd86828
2 changed files with 26 additions and 25 deletions
+1
View File
@@ -16,6 +16,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
- ENS RD 311/2022 (AWS) compliance mapping: `vpc_different_regions` was uncorrectly mapped under the `mp.com.4` family (Network segregation). That check is now mapped to a new `op.cont.2.aws.vpc.1` requirement under the Continuity of Service control [(#11372)](https://github.com/prowler-cloud/prowler/pull/11372)
- Compliance CSV row count now matches the UI per requirement by sourcing rows from the framework JSON's `requirement.Checks` instead of the stale `finding.compliance` snapshot [(#11370)](https://github.com/prowler-cloud/prowler/pull/11370)
- OpenStack provider exception codes moved from the `10000-10999` range, shared with the AlibabaCloud provider, to the free `17000-17999` range to keep error codes unambiguous [(#11382)](https://github.com/prowler-cloud/prowler/pull/11382)
---
@@ -1,56 +1,56 @@
from prowler.exceptions.exceptions import ProwlerException
# Exceptions codes from 10000 to 10999 are reserved for OpenStack exceptions
# Exceptions codes from 17000 to 17999 are reserved for OpenStack exceptions
class OpenStackBaseException(ProwlerException):
"""Base class for OpenStack Errors."""
OPENSTACK_ERROR_CODES = {
(10000, "OpenStackCredentialsError"): {
(17000, "OpenStackCredentialsError"): {
"message": "OpenStack credentials not found or invalid",
"remediation": "Check the OpenStack API credentials and ensure they are properly set.",
},
(10001, "OpenStackAuthenticationError"): {
(17001, "OpenStackAuthenticationError"): {
"message": "OpenStack authentication failed",
"remediation": "Check the OpenStack API credentials and ensure they are valid.",
},
(10002, "OpenStackSessionError"): {
(17002, "OpenStackSessionError"): {
"message": "OpenStack session setup failed",
"remediation": "Check the session setup and ensure it is properly configured.",
},
(10003, "OpenStackIdentityError"): {
(17003, "OpenStackIdentityError"): {
"message": "OpenStack identity setup failed",
"remediation": "Check credentials and ensure they are properly set up for OpenStack.",
},
(10004, "OpenStackAPIError"): {
(17004, "OpenStackAPIError"): {
"message": "OpenStack API call failed",
"remediation": "Check the API request and ensure it is properly formatted.",
},
(10005, "OpenStackRateLimitError"): {
(17005, "OpenStackRateLimitError"): {
"message": "OpenStack API rate limit exceeded",
"remediation": "Reduce the number of API requests or wait before making more requests.",
},
(10006, "OpenStackConfigFileNotFoundError"): {
(17006, "OpenStackConfigFileNotFoundError"): {
"message": "OpenStack clouds.yaml configuration file not found",
"remediation": "Check that the clouds.yaml file exists at the specified path or in standard locations (~/.config/openstack/clouds.yaml, /etc/openstack/clouds.yaml, ./clouds.yaml).",
},
(10007, "OpenStackCloudNotFoundError"): {
(17007, "OpenStackCloudNotFoundError"): {
"message": "Specified cloud not found in clouds.yaml configuration",
"remediation": "Check that the cloud name exists in your clouds.yaml file and is properly configured.",
},
(10008, "OpenStackInvalidConfigError"): {
(17008, "OpenStackInvalidConfigError"): {
"message": "Invalid or malformed clouds.yaml configuration file",
"remediation": "Check that the clouds.yaml file is valid YAML and follows the OpenStack configuration format.",
},
(10009, "OpenStackInvalidProviderIdError"): {
(17009, "OpenStackInvalidProviderIdError"): {
"message": "Provider ID does not match the project_id in clouds.yaml",
"remediation": "Ensure the provider_id matches the project_id configured in your clouds.yaml file.",
},
(10010, "OpenStackNoRegionError"): {
(17010, "OpenStackNoRegionError"): {
"message": "No region configuration found in clouds.yaml",
"remediation": "Add either 'region_name' (single region) or 'regions' (list of regions) to your cloud configuration in clouds.yaml.",
},
(10011, "OpenStackAmbiguousRegionError"): {
(17011, "OpenStackAmbiguousRegionError"): {
"message": "Ambiguous region configuration in clouds.yaml",
"remediation": "Use either 'region_name' or 'regions' in your cloud configuration, not both.",
},
@@ -75,7 +75,7 @@ class OpenStackCredentialsError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10000,
code=17000,
file=file,
original_exception=original_exception,
message=message,
@@ -87,7 +87,7 @@ class OpenStackAuthenticationError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10001,
code=17001,
file=file,
original_exception=original_exception,
message=message,
@@ -99,7 +99,7 @@ class OpenStackSessionError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10002,
code=17002,
file=file,
original_exception=original_exception,
message=message,
@@ -111,7 +111,7 @@ class OpenStackIdentityError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10003,
code=17003,
file=file,
original_exception=original_exception,
message=message,
@@ -123,7 +123,7 @@ class OpenStackAPIError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10004,
code=17004,
file=file,
original_exception=original_exception,
message=message,
@@ -135,7 +135,7 @@ class OpenStackRateLimitError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10005,
code=17005,
file=file,
original_exception=original_exception,
message=message,
@@ -147,7 +147,7 @@ class OpenStackConfigFileNotFoundError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10006,
code=17006,
file=file,
original_exception=original_exception,
message=message,
@@ -159,7 +159,7 @@ class OpenStackCloudNotFoundError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10007,
code=17007,
file=file,
original_exception=original_exception,
message=message,
@@ -171,7 +171,7 @@ class OpenStackInvalidConfigError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10008,
code=17008,
file=file,
original_exception=original_exception,
message=message,
@@ -183,7 +183,7 @@ class OpenStackInvalidProviderIdError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10009,
code=17009,
file=file,
original_exception=original_exception,
message=message,
@@ -195,7 +195,7 @@ class OpenStackNoRegionError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10010,
code=17010,
file=file,
original_exception=original_exception,
message=message,
@@ -207,7 +207,7 @@ class OpenStackAmbiguousRegionError(OpenStackBaseException):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
code=10011,
code=17011,
file=file,
original_exception=original_exception,
message=message,