Open sbernhard opened 9 months ago
Workaround for https://projects.theforeman.org/issues/30199
Review would be nice @orrabin / @ShimShtein
Thoughts on this @ShimShtein ?
ping @ShimShtein :-)
I think we don't want to push
0
as the storage domain id, ifstorage_domains
returned nil or and empty list. If we don't use the safe navigation operator here, we will end up in therescue
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.
This would then not work. The original issue was:
So, attachment_disk.storage_domains
is nil and the access to "[0]" crashes. In this case, and only in this case it should return with "0" which would then work in case of direct attached LUN disks.
Its still better to return 0 instead of crashing.
@sbernhard There were quite some changes on the default branch. Could you rebase to enable the CI?
@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.
@ShimShtein can you have a look at this again, please?
Thanks @Manisha15