Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit c97c691

Browse files
committed
should check the return value of os.DiskIsAttached
1 parent e24e335 commit c97c691

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/cloudprovider/providers/openstack/openstack_volumes.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,11 @@ func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error) {
419419
func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error) {
420420
attached := make(map[string]bool)
421421
for _, volumeID := range volumeIDs {
422-
isAttached, _ := os.DiskIsAttached(instanceID, volumeID)
422+
isAttached, err := os.DiskIsAttached(instanceID, volumeID)
423+
if err != nil && err != ErrNotFound {
424+
attached[volumeID] = true
425+
continue
426+
}
423427
attached[volumeID] = isAttached
424428
}
425429
return attached, nil

0 commit comments

Comments
 (0)