-
Notifications
You must be signed in to change notification settings - Fork 898
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
Datastores duplicated after a refresh #16408
Conversation
@pkliczewski I thought we couldn't just use |
Oh it was because this is using the |
@agrare BTW. Travis failure is not related to this PR |
@@ -124,7 +124,7 @@ def ems_clusters(extra_attributes = {}) | |||
def storages(extra_attributes = {}) | |||
attributes = { | |||
:model_class => ::Storage, | |||
# TODO: change :manager_ref => [:location], | |||
:manager_ref => [:location], |
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.
So, is the location unique in a whole provider? If yes, then it's ok.
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.
It is unique
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.
Well it can be just an NFS path, https://github.com/ManageIQ/manageiq-providers-ovirt/blob/master/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb#L46
This will not be unique across providers on purpose, the idea is that it will link the same storage across providers
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.
Correct it is unique within single provider. Do you have a suggestion how to make sure it is unique across the providers?
There was no way to identify uniqely datastore during a refresh which resulted in duplications. This PR solves this issue. Bug-Url: https://bugzilla.redhat.com/1510053
Checked commit pkliczewski@fc3684e with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.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.
Ok, this should work, but without spec, we will not know for sure :-)
@pkliczewski can you test that this picks up existing storages? Maybe create a storage manually with an expected location and make sure that is picked up and not duplicated. |
@agrare I can confirm it picks up existing storages |
👍 thanks @pkliczewski |
@simaishi please backport ManageIQ/manageiq-providers-vmware#135 once this is backported |
Datastores duplicated after a refresh (cherry picked from commit c736542)
Gaprindashvili backport details:
|
There was no way to identify uniquely datastore during a refresh
which resulted in duplications. This PR solves this issue.
Bug-Url:
https://bugzilla.redhat.com/1510053