Skip to content

Commit

Permalink
[LINT-FIX]
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed Jan 11, 2025
1 parent dddd6d8 commit 152f355
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions port_ocean/core/defaults/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/exceptions/port_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 152f355

Please sign in to comment.