use of com.iwave.ext.linux.command.UnmountCommand in project coprhd-controller by CoprHD.
the class LinuxMountUtils method unmountPath.
public void unmountPath(String path) throws InternalException {
UnmountCommand command = new UnmountCommand(STD_TIMEOUT);
command.setPath(path);
command.addArgument("; if [ $? -eq 124 ] ; then >&2 echo TIMEOUT ; else >&2 echo SUCCESSFUL ; fi");
_log.info("unmount command:" + command.getResolvedCommandLine());
cli.executeCommand(command);
CommandOutput output = command.getOutput();
if (output.getStderr().contains("TIMEOUT")) {
ComputeSystemControllerException exception = ComputeSystemControllerException.exceptions.commandTimedOut(host.getHostName());
throw exception;
} else {
String errMessage = output.getStderr().replace("SUCCESSFUL", "").replace("\n", "");
if (!errMessage.isEmpty()) {
ComputeSystemControllerException exception = ComputeSystemControllerException.exceptions.unableToUnmount(host.getHostName(), new Exception(errMessage));
throw exception;
}
}
}
use of com.iwave.ext.linux.command.UnmountCommand in project coprhd-controller by CoprHD.
the class UnmountPath method execute.
@Override
public void execute() throws Exception {
try {
UnmountCommand command = new UnmountCommand();
command.setPath(path);
executeCommand(command, SHORT_TIMEOUT);
} catch (Exception ex) {
ExecutionUtils.fail("failTask.UnmountPath", new Object[] { path }, path, ex.getMessage(), path);
}
}
use of com.iwave.ext.linux.command.UnmountCommand in project coprhd-controller by CoprHD.
the class UnmountPath method execute.
@Override
public void execute() throws Exception {
UnmountCommand command = new UnmountCommand();
command.setPath(path);
executeCommand(command, SHORT_TIMEOUT);
}
use of com.iwave.ext.linux.command.UnmountCommand in project coprhd-controller by CoprHD.
the class UnmountPath method execute.
@Override
public void execute() throws Exception {
try {
UnmountCommand command = new UnmountCommand();
command.setPath(path);
executeCommand(command, SHORT_TIMEOUT);
} catch (Exception ex) {
ExecutionUtils.fail("failTask.UnmountPath", new Object[] { path }, path, ex.getMessage(), path);
}
}
Aggregations