Merge pull request #11741 from aneshas/11720-redundant-else
Fixed redundant else in GetDeviceStatus
This commit is contained in:
commit
3bed92a7bf
1 changed files with 7 additions and 5 deletions
|
@ -1549,14 +1549,16 @@ func (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error) {
|
|||
return nil, fmt.Errorf("Error activating devmapper device for '%s': %s", hash, err)
|
||||
}
|
||||
|
||||
if sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName()); err != nil {
|
||||
sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName())
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
status.SizeInSectors = sizeInSectors
|
||||
status.MappedSectors = mappedSectors
|
||||
status.HighestMappedSector = highestMappedSector
|
||||
}
|
||||
|
||||
status.SizeInSectors = sizeInSectors
|
||||
status.MappedSectors = mappedSectors
|
||||
status.HighestMappedSector = highestMappedSector
|
||||
|
||||
return status, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue