-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 storage domain issue when attaching LUN #107
Conversation
Workaround for https://projects.theforeman.org/issues/30199 Review would be nice @orrabin / @ShimShtein |
ac884be
to
aa0cf63
Compare
Thoughts on this @ShimShtein ? |
aa0cf63
to
d160629
Compare
ping @ShimShtein :-) |
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 we don't want to push 0
as the storage domain id, if storage_domains
returned nil or and empty list. If we don't use the safe navigation operator here, we will end up in the rescue
block (which is not desired, I think)
I can understand that in the case of an actual error, we can assume there is at least one domain, but we can't get the list, so we assume there is only one.
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.
Didn't test it, but now the code looks good.
I see three cases here:
storage_domains
returns one or more domains (the "happy" path), then thestorage_domain
property would be set to the first domain from the liststorage_domains
returns an empty list, then thestorage_domain
property should be set tonil
(we didn't find a good candidate).storage_domains
throws an exception, then we want to guess the storage domain id. We are setting thestorage_domain
property to0
, since it's our best guess.
@sbernhard There were quite some changes on the default branch. Could you rebase to enable the CI? |
e757a56
to
ba62838
Compare
@ShimShtein I had a look at the code again.
This is what https://bugzilla.redhat.com/show_bug.cgi?id=1882404#c9 suggestes and works for us. |
ba62838
to
3967da4
Compare
3967da4
to
9a03112
Compare
@ShimShtein can you have a look at this again, please? |
@ShimShtein Do you think you could merge this? We do not have the necessary permissions. |
Thanks @Manisha15