Skip to content

Commit

Permalink
Update deps and improve settings handling
Browse files Browse the repository at this point in the history
  • Loading branch information
eruvanos committed Aug 27, 2024
1 parent 9c07453 commit 0b247e6
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 242 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
=============
=========

**4.7.1**
- Update depenendcies
- Read settings values during check, instead of import time

**4.7.0**
- Update to latest dependencies (incl Flask >=3)
Expand Down
6 changes: 3 additions & 3 deletions openbrokerapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ServiceBroker,
OperationState,
)
from openbrokerapi.settings import MIN_VERSION, DISABLE_VERSION_CHECK
import openbrokerapi.settings


def _check_plan_id(broker: ServiceBroker, plan_id) -> bool:
Expand Down Expand Up @@ -78,13 +78,13 @@ def get_blueprint(
logger.debug("Apply print_request filter for debugging")
openbroker.before_request(print_request)

if DISABLE_VERSION_CHECK:
if openbrokerapi.settings.DISABLE_VERSION_CHECK:
logger.warning(
"Minimum API version is not checked, this can cause illegal contracts between service broker and platform!",
stacklevel=0
)
else:
logger.debug("Apply check_version filter for version %s" % str(MIN_VERSION))
logger.debug("Apply check_version filter for version %s" % str(openbrokerapi.settings.MIN_VERSION))
openbroker.before_request(check_version)

# apply filter: global load X-Broker-API-Originating-Identity
Expand Down
4 changes: 2 additions & 2 deletions openbrokerapi/service_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ServiceMetadata,
ServicePlan,
)
from openbrokerapi.settings import DISABLE_SPACE_ORG_GUID_CHECK
import openbrokerapi.settings


class ProvisionDetails:
Expand Down Expand Up @@ -37,7 +37,7 @@ def __init__(
raise TypeError("space_guid does not match with context.space_guid")
self.space_guid = context["space_guid"]

if DISABLE_SPACE_ORG_GUID_CHECK:
if openbrokerapi.settings.DISABLE_SPACE_ORG_GUID_CHECK:
pass
elif None in (self.organization_guid, self.space_guid):
raise TypeError("Organization and space guid are required.")
Expand Down
Loading

0 comments on commit 0b247e6

Please sign in to comment.