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

Custom reconnect block #15605

Merged
merged 4 commits into from
Jul 24, 2017
Merged

Custom reconnect block #15605

merged 4 commits into from
Jul 24, 2017

Conversation

Ladas
Copy link
Contributor

@Ladas Ladas commented Jul 19, 2017

Custom reconnect block allowing us to implement a complex reconnect logic of records.

Ladas added 3 commits July 19, 2017 15:48
Add custom_reconnect_block to handle complex reconnect logic
Invoke custom_reconnect_block if defined as part of saving,
allowing us to do reconnec instead of saving.
Test that reconnect logic works
@Ladas
Copy link
Contributor Author

Ladas commented Jul 19, 2017

@miq-bot assign @agrare
@miq-bot add_label enhancement

Fix rubocop issues
@Ladas Ladas force-pushed the custom_reconnect_block branch from 675af3f to f805115 Compare July 20, 2017 08:56
@miq-bot
Copy link
Member

miq-bot commented Jul 20, 2017

Checked commits Ladas/manageiq@9b04398~...f805115 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. 🍰

@@ -67,6 +67,10 @@ def save!(inventory_collection, association)
end
end

unless inventory_collection.custom_reconnect_block.nil?
inventory_collection.custom_reconnect_block.call(inventory_collection, inventory_objects_index, attributes_index)
end
Copy link
Member

Choose a reason for hiding this comment

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

So for objects that are re-connected by this block, what prevents them from being created by the next section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now we need to remove them from inventory_objects_index, the rest will get created.

I think once we implement this for hosts and vms, we can generalize this alghorithm

Copy link
Member

Choose a reason for hiding this comment

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

Ah okay thanks

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

I'm good with this for now but I think we should move towards the reconnect block just finding the records to reconnect then having the core save code just do a normal update.

@agrare agrare merged commit 7faa944 into ManageIQ:master Jul 24, 2017
@agrare agrare added this to the Sprint 65 Ending Jul 24, 2017 milestone Jul 24, 2017
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.

3 participants