Skip to content

Commit

Permalink
feat(deployment): fixes component override error
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsingh21 committed Aug 29, 2023
1 parent 3e0ab26 commit 2bb1594
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions riocli/deployment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,32 +115,6 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
provision_config.add_rosbag_job(component_name,
self._form_rosbag_job(req_job))

if 'features' in self.spec:
if 'params' in self.spec.features and self.spec.features.params.enabled:
component_id = internal_component.componentId
tree_names = self.spec.features.params.get('trees', [])
disable_sync = self.spec.features.params.get('disableSync',
False)

args = []
for e in executables:
args.append({
'executableId': e['id'],
'paramTreeNames': tree_names,
'enableParamSync': not disable_sync
})

context = provision_config.context
if 'component_context' not in context:
context['component_context'] = {}

component_context = context['component_context']
if component_id not in component_context:
component_context[component_id] = {}

component_context[component_id][
'param_sync_exec_args'] = args

if self.spec.runtime == 'cloud':
if 'staticRoutes' in self.spec:
for stroute in self.spec.staticRoutes:
Expand Down Expand Up @@ -215,6 +189,32 @@ def create_object(self, client: Client, **kwargs) -> typing.Any:
provision_config = add_mount_volume_provision_config(
provision_config, component_name, device, exec_mounts)

if 'features' in self.spec:
if 'params' in self.spec.features and self.spec.features.params.enabled:
component_id = internal_component.componentId
tree_names = self.spec.features.params.get('trees', [])
disable_sync = self.spec.features.params.get('disableSync',
False)

args = []
for e in executables:
args.append({
'executableId': e['id'],
'paramTreeNames': tree_names,
'enableParamSync': not disable_sync
})

context = provision_config.context
if 'component_context' not in context:
context['component_context'] = {}

component_context = context['component_context']
if component_id not in component_context:
component_context[component_id] = {}

component_context[component_id][
'param_sync_exec_args'] = args

provision_config.set_component_alias(component_name,
self.metadata.name)

Expand Down

0 comments on commit 2bb1594

Please sign in to comment.