From 152f355f62511b624a6704009b8d149ab6e1cb41 Mon Sep 17 00:00:00 2001 From: erikzaadi Date: Sat, 11 Jan 2025 16:26:43 +0200 Subject: [PATCH] [LINT-FIX] --- port_ocean/core/defaults/initialize.py | 16 ++++++++++++---- port_ocean/exceptions/port_defaults.py | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/port_ocean/core/defaults/initialize.py b/port_ocean/core/defaults/initialize.py index 428fcdc15a..869d4f7fcc 100644 --- a/port_ocean/core/defaults/initialize.py +++ b/port_ocean/core/defaults/initialize.py @@ -56,8 +56,8 @@ def deconstruct_blueprints_to_creation_steps( async def _initialize_required_integration_settings( port_client: PortClient, - default_mapping: PortAppConfig, integration_config: IntegrationConfiguration, + default_mapping: PortAppConfig | None = None, ) -> None: try: logger.info("Initializing integration at port") @@ -103,8 +103,10 @@ async def _initialize_required_integration_settings( async def _create_resources( port_client: PortClient, - defaults: Defaults, + defaults: Defaults | None = None, ) -> None: + if not defaults: + return creation_stage, *blueprint_patches = deconstruct_blueprints_to_creation_steps( defaults.blueprints ) @@ -218,9 +220,15 @@ async def _initialize_defaults( logger.warning("No defaults found. Skipping initialization...") return None - if defaults.port_app_config or integration_config.use_provisioned_defaults: + if ( + defaults + and defaults.port_app_config + or integration_config.use_provisioned_defaults + ): await _initialize_required_integration_settings( - port_client, defaults.port_app_config, integration_config + port_client, + integration_config, + defaults.port_app_config if defaults else None, ) if not integration_config.initialize_port_resources: diff --git a/port_ocean/exceptions/port_defaults.py b/port_ocean/exceptions/port_defaults.py index 35f93b858d..bd59412909 100644 --- a/port_ocean/exceptions/port_defaults.py +++ b/port_ocean/exceptions/port_defaults.py @@ -19,7 +19,7 @@ class UnsupportedDefaultFileType(BaseOceanException): class DefaultsProvisionFailed(BaseOceanException): def __init__( self, - retries, + retries: int, ): super().__init__( f"Failed to retrieve integration config after {retries} attempts"