fix missing await, errors on failure to reload iscsi service
This commit is contained in:
parent
001301d53e
commit
4f48cfc640
|
|
@ -1388,20 +1388,35 @@ class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
||||||
async expandVolume(call, datasetName) {
|
async expandVolume(call, datasetName) {
|
||||||
const driverShareType = this.getDriverShareType();
|
const driverShareType = this.getDriverShareType();
|
||||||
const sshClient = this.getSshClient();
|
const sshClient = this.getSshClient();
|
||||||
|
let response;
|
||||||
|
|
||||||
switch (driverShareType) {
|
switch (driverShareType) {
|
||||||
case "iscsi":
|
case "iscsi":
|
||||||
const isScale = this.getIsScale();
|
const isScale = await this.getIsScale();
|
||||||
if (isScale) {
|
if (isScale) {
|
||||||
this.ctx.logger.verbose("FreeNAS reloading scst");
|
this.ctx.logger.verbose("FreeNAS reloading scst");
|
||||||
await sshClient.exec(
|
response = await sshClient.exec(
|
||||||
sshClient.buildCommand("systemctl", ["reload", "scst"])
|
sshClient.buildCommand("systemctl", ["reload", "scst"])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (response.code != 0) {
|
||||||
|
throw new GrpcError(
|
||||||
|
grpc.status.UNKNOWN,
|
||||||
|
`error reloading scst: ${JSON.stringify(response)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.ctx.logger.verbose("FreeNAS reloading ctld");
|
this.ctx.logger.verbose("FreeNAS reloading ctld");
|
||||||
await sshClient.exec(
|
response = await sshClient.exec(
|
||||||
sshClient.buildCommand("/etc/rc.d/ctld", ["reload"])
|
sshClient.buildCommand("/etc/rc.d/ctld", ["reload"])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (response.code != 0) {
|
||||||
|
throw new GrpcError(
|
||||||
|
grpc.status.UNKNOWN,
|
||||||
|
`error reloading ctld: ${JSON.stringify(response)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue