more robust smb delete for freenas
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
b9e4f20863
commit
888556aa5e
|
|
@ -520,7 +520,7 @@ delete ${iscsiName}
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
if (response.code != 0) {
|
if (response.code != 0) {
|
||||||
throw new Error(JSON.stringify(response));
|
throw new Error(response);
|
||||||
}
|
}
|
||||||
driver.ctx.logger.verbose(
|
driver.ctx.logger.verbose(
|
||||||
"TargetCLI response: " + JSON.stringify(response)
|
"TargetCLI response: " + JSON.stringify(response)
|
||||||
|
|
|
||||||
|
|
@ -1528,7 +1528,10 @@ class FreeNASApiDriver extends CsiBaseDriver {
|
||||||
// returns a 500 if does not exist
|
// returns a 500 if does not exist
|
||||||
// v1 = 204
|
// v1 = 204
|
||||||
// v2 = 200
|
// v2 = 200
|
||||||
if (![200, 204].includes(response.statusCode)) {
|
if (
|
||||||
|
![200, 204].includes(response.statusCode) &&
|
||||||
|
!JSON.stringify(response.body).includes("does not exist")
|
||||||
|
) {
|
||||||
throw new GrpcError(
|
throw new GrpcError(
|
||||||
grpc.status.UNKNOWN,
|
grpc.status.UNKNOWN,
|
||||||
`received error deleting smb share - share: ${shareId} code: ${
|
`received error deleting smb share - share: ${shareId} code: ${
|
||||||
|
|
|
||||||
|
|
@ -1577,7 +1577,10 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
|
||||||
// returns a 500 if does not exist
|
// returns a 500 if does not exist
|
||||||
// v1 = 204
|
// v1 = 204
|
||||||
// v2 = 200
|
// v2 = 200
|
||||||
if (![200, 204].includes(response.statusCode)) {
|
if (
|
||||||
|
![200, 204].includes(response.statusCode) &&
|
||||||
|
!JSON.stringify(response.body).includes("does not exist")
|
||||||
|
) {
|
||||||
throw new GrpcError(
|
throw new GrpcError(
|
||||||
grpc.status.UNKNOWN,
|
grpc.status.UNKNOWN,
|
||||||
`received error deleting smb share - share: ${shareId} code: ${
|
`received error deleting smb share - share: ${shareId} code: ${
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue