Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37374 - Prefer execution interface over primary #10136

Merged
merged 1 commit into from
May 16, 2024

Conversation

adamruzicka
Copy link
Contributor

in Ansible Inventory report template.

The execution interface method is not defined (and exposed in safemode jail) unless remote execution plugin is enabled.

It could have been a bit nicer if safemode exposed Array#find

@ofedoren
Copy link
Member

It could have been a bit nicer if safemode exposed Array#find

I think we can expose it: https://github.com/theforeman/foreman/blob/develop/config/initializers/safemode_jail.rb#L27

Comment on lines 180 to 182
inventory_data.update('ipv4': net_sources.find { |s| s.ip }&.ip) if input_ipv4
inventory_data.update('ipv6': net_sources.find { |s| s.ip6 }&.ip6) if input_ipv6
inventory_data.update('subnet': net_sources.find { |s| s.subnet }&.subnet) if input_subnet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud: can it happen that you have an ip that comes from the execution interface but the subnet that comes from the host? Wouldn't that be confusing? Same for ip6 & subnet6 of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ekohl
Copy link
Member

ekohl commented Apr 26, 2024

Will you squash the commits?

in Ansible Inventory report template.

The execution interface method is not defined (and exposed in safemode
jail) unless remote execution plugin is enabled.
@adamruzicka adamruzicka merged commit c75c51b into theforeman:develop May 16, 2024
52 of 53 checks passed
@adamruzicka adamruzicka deleted the ansible-inventory branch May 16, 2024 14:39
@adamruzicka
Copy link
Contributor Author

Took the liberty of merging this myself since it was approved some time ago. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants