mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cleanup: return error type in rbdGetDeviceList()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
4dde3fc9e0
commit
7eae69f10c
@ -87,7 +87,7 @@ func rbdGetDeviceList(ctx context.Context, accessType string) ([]rbdDeviceInfo,
|
|||||||
|
|
||||||
stdout, _, err := util.ExecCommand(ctx, rbd, "device", "list", "--format="+"json", "--device-type", accessType)
|
stdout, _, err := util.ExecCommand(ctx, rbd, "device", "list", "--format="+"json", "--device-type", accessType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error getting device list from rbd for devices of type (%s): (%v)", accessType, err)
|
return nil, fmt.Errorf("error getting device list from rbd for devices of type (%s): %w", accessType, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if accessType == accessTypeKRbd {
|
if accessType == accessTypeKRbd {
|
||||||
@ -96,7 +96,7 @@ func rbdGetDeviceList(ctx context.Context, accessType string) ([]rbdDeviceInfo,
|
|||||||
err = json.Unmarshal([]byte(stdout), &nbdDeviceList)
|
err = json.Unmarshal([]byte(stdout), &nbdDeviceList)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error to parse JSON output of device list for devices of type (%s): (%v)", accessType, err)
|
return nil, fmt.Errorf("error to parse JSON output of device list for devices of type (%s): %w", accessType, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert output to a rbdDeviceInfo list for consumers
|
// convert output to a rbdDeviceInfo list for consumers
|
||||||
|
Loading…
Reference in New Issue
Block a user