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

introduce clusterless hosts as an association #20047

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Apr 3, 2020

This was causing an issue when the association was references (but it wasn't really an association)

hosts = FactoryBot.create_list(:host, 2, :ext_management_system => ems)
FactoryBot.create_list(:host, 2, :ext_management_system => ems, :ems_cluster => cluster)

expect(ems.clusterless_hosts).to match_array(hosts)
Copy link
Member

Choose a reason for hiding this comment

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

How about 1 host with a cluster and 1 clusterless host and assert only the latter is returned?

Copy link
Member

Choose a reason for hiding this comment

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

Keenan pointed me at line 34 where it's creating a clustered host so we can be sure it's only returning the non-clustered hosts and not the clustered ones. 👍

@kbrock kbrock force-pushed the infra_clusterless_hosts branch 3 times, most recently from f1eb50e to 0eced14 Compare April 3, 2020 17:33
@kbrock kbrock force-pushed the infra_clusterless_hosts branch from 0eced14 to b0dc064 Compare April 3, 2020 17:34
@miq-bot
Copy link
Member

miq-bot commented Apr 3, 2020

Checked commit kbrock@b0dc064 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 👍

@jrafanie jrafanie merged commit 7320484 into ManageIQ:master Apr 3, 2020
@jrafanie jrafanie self-assigned this Apr 3, 2020
@chessbyte chessbyte mentioned this pull request Apr 3, 2020
38 tasks
@jrafanie
Copy link
Member

jrafanie commented Apr 3, 2020

Note, rails 5.1 seems to have just discarded bogus associations when you call preload but 5.2 is very picky and complains.

@kbrock kbrock deleted the infra_clusterless_hosts branch April 3, 2020 23:35
simaishi pushed a commit that referenced this pull request Apr 16, 2020
introduce clusterless hosts as an association

(cherry picked from commit 7320484)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit 0295f09bf66578ae4a1df4270cc79aa8fc4bb2ca
Author: Joe Rafaniello <[email protected]>
Date:   Fri Apr 3 15:20:05 2020 -0400

    Merge pull request #20047 from kbrock/infra_clusterless_hosts

    introduce clusterless hosts as an association

    (cherry picked from commit 7320484c5191ed1bea8312343837424893d51566)

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

Successfully merging this pull request may close these issues.

5 participants