-
Notifications
You must be signed in to change notification settings - Fork 983
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
Refs #36517 - Correct host search for IPv6 on subnet list #9739
Conversation
Issues: #36517 |
<td> | ||
<%= | ||
# TODO: this only works for IPv4 | ||
count = hosts_count[subnet] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comes from:
foreman/app/helpers/application_helper.rb
Lines 327 to 329 in 59bf491
def hosts_count(resource_name = controller.resource_name) | |
@hosts_count ||= HostCounter.new(resource_name) | |
end |
Which in turn comes from HostCounter.
The search linked to subnet.name= instead of subnet6.name, which meant there was nothing found. This doesn't address the bug that it doesn't look at IPv6 subnets for the count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected, just one nit about the RM in the comment
<td><%= link_to_if_authorized(hosts_count[subnet], hash_for_hosts_path(:search => "subnet.name=\"#{subnet}\"")) %> | ||
<td> | ||
<%= | ||
# TODO: https://projects.theforeman.org/issues/36517 this only works for IPv4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO is linked to Redmine for this PR. Shouldn't there be a different Redmine issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this PR to be Refs, because I still think the real issue isn't solved. I could change this to be a unique RM issue just for the broken link, but if the count isn't correct I'm not sure anyone will click on it. The problem is that for every IPv6 subnet the count is 0. After this patch it will link to a listing that may be non-empty, but the label still says 0 so users may not click on it.
Thanks @ekohl |
The search linked to subnet.name= instead of subnet6.name, which meant there was nothing found.
This doesn't address the bug that it doesn't look at IPv6 subnets for the count.