Skip to content

Commit

Permalink
always set the parent resource type to the one of the entity
Browse files Browse the repository at this point in the history
there is no way those can be different, but if left unset, other code
sets it to "parents" which is obviously wrong

Closes: #1684
  • Loading branch information
evgeni committed Apr 8, 2024
1 parent 7864a1b commit 6996ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/module_utils/foreman_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,8 @@ def __init__(self, **kwargs):
))[0])

if 'parent' in self.foreman_spec and self.foreman_spec['parent'].get('type') == 'entity':
if 'resouce_type' not in self.foreman_spec['parent']:
self.foreman_spec['parent']['resource_type'] = self.foreman_spec['entity']['resource_type']
# ensure parent and entity are the same type
self.foreman_spec['parent']['resource_type'] = self.foreman_spec['entity']['resource_type']
if 'failsafe' not in self.foreman_spec['parent']:
self.foreman_spec['parent']['failsafe'] = True
current, parent = split_fqn(self.foreman_params[self.entity_key])
Expand Down

0 comments on commit 6996ae2

Please sign in to comment.