mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.18 to 4.19
* 4.18: linstor: disconnect-disk also search for resource name in Linstor (#9035)
This commit is contained in:
commit
92ba476593
@ -316,7 +316,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
|
||||
null,
|
||||
null);
|
||||
|
||||
optRsc = getResourceByPath(resources, volumePath);
|
||||
optRsc = getResourceByPathOrName(resources, volumePath);
|
||||
} catch (ApiException apiEx) {
|
||||
// couldn't query linstor controller
|
||||
s_logger.error(apiEx.getBestMessage());
|
||||
@ -376,9 +376,10 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
|
||||
return false;
|
||||
}
|
||||
|
||||
private Optional<ResourceWithVolumes> getResourceByPath(final List<ResourceWithVolumes> resources, String path) {
|
||||
private Optional<ResourceWithVolumes> getResourceByPathOrName(
|
||||
final List<ResourceWithVolumes> resources, String path) {
|
||||
return resources.stream()
|
||||
.filter(rsc -> rsc.getVolumes().stream()
|
||||
.filter(rsc -> getLinstorRscName(path).equalsIgnoreCase(rsc.getName()) || rsc.getVolumes().stream()
|
||||
.anyMatch(v -> path.equals(v.getDevicePath())))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user