-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix parent association in graph refresh #291
Conversation
@@ -72,7 +72,7 @@ def instances | |||
series = persister.flavors.find(instance.properties.hardware_profile.vm_size.downcase) | |||
|
|||
rg_ems_ref = collector.get_resource_group_ems_ref(instance) | |||
parent_ref = collector.parent_ems_ref(instance) | |||
parent_ref = collector.parent_ems_ref(instance).try(:downcase) |
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.
@djberg96 are all possible parent ems_refs downcased? Could we just do this in parent_ems_ref
? Want to avoid someone else using this method without knowing they need to downcase the result to be able to reference something.
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.
Unfortunately, we only did it for the managed images, not the unmanaged ones. I could modify it there, but then I would need to modify the parser again, plus add a data migration.
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.
No that's fine, how about here ? Could we do .try(:image_reference).try(:id).try(:downcase)
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.
Yeah, that should work. I'll update it.
Checked commits https://github.com/djberg96/manageiq-providers-azure/compare/20b52b9d9b320005b035bff7c21a7c2aae54c137~...11930288795ef5d429effefaade96ac874147046 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
LGTM
The when setting a parent, the
parent_ems_ref
helper method pulls its information straight from the JSON properties. Consequently, we need to explicitly downcase it to ensure that the association is set correctly.