Skip to content

Commit

Permalink
fix(deployment): sets dependent deployment ready phase to PROVISIONING
Browse files Browse the repository at this point in the history
  • Loading branch information
smrutisenapati authored and pallabpain committed Aug 3, 2023
1 parent 9235863 commit 1444186
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions riocli/deployment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
retry_interval = int(kwargs.get('retry_interval'))

if 'runtime' in self.spec and runtime != self.spec.runtime:
click.secho(
'>> runtime mismatch => ' +
'deployment:{}.runtime !== package:{}.runtime '.format(
raise Exception('>> runtime mismatch => deployment:{}.runtime !== package:{}.runtime '.format(
self.metadata.name, pkg['packageName']
), fg=Colors.RED)
return
))

provision_config = pkg.get_provision_configuration(plan_id)

Expand All @@ -97,7 +94,9 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
dep_guid, dep = self.rc.find_depends(item)
if dep is None and dep_guid:
dep = client.get_deployment(dep_guid)
provision_config.add_dependent_deployment(dep)
provision_config.add_dependent_deployment(dep, ready_phases=[
DeploymentPhaseConstants.PROVISIONING.value,
DeploymentPhaseConstants.SUCCEEDED.value])

# Add Network
if 'rosNetworks' in self.spec:
Expand Down Expand Up @@ -224,7 +223,9 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
deployment = pkg.provision(self.metadata.name, provision_config)

try:
deployment.poll_deployment_till_ready(retry_count=retry_count, sleep_interval=retry_interval, ready_phases=[DeploymentPhaseConstants.PROVISIONING.value])
deployment.poll_deployment_till_ready(retry_count=retry_count, sleep_interval=retry_interval,
ready_phases=[DeploymentPhaseConstants.PROVISIONING.value,
DeploymentPhaseConstants.SUCCEEDED.value])
except DeploymentNotRunningException as e:
raise Exception(process_deployment_errors(e)) from e
except Exception as e:
Expand Down

0 comments on commit 1444186

Please sign in to comment.