use of com.iwave.ext.linux.command.MountCommand in project coprhd-controller by CoprHD.
the class LinuxSystemCLI method mountAll.
public void mountAll() {
MountCommand command = new MountCommand();
command.setMountAll();
executeCommand(command);
}
use of com.iwave.ext.linux.command.MountCommand in project coprhd-controller by CoprHD.
the class MountPath method execute.
@Override
public void execute() throws Exception {
MountCommand command = new MountCommand();
command.setPath(path);
executeCommand(command, SHORT_TIMEOUT);
}
use of com.iwave.ext.linux.command.MountCommand in project coprhd-controller by CoprHD.
the class LinuxMountUtils method mountPath.
public void mountPath(String path) throws InternalException {
MountCommand command = new MountCommand(STD_TIMEOUT);
command.setPath(path);
command.addArgument("; if [ $? -eq 124 ] ; then >&2 echo TIMEOUT ; else >&2 echo SUCCESSFUL ; fi");
_log.info("mount 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.unableToMount(host.getHostName(), new Exception(errMessage));
throw exception;
}
}
}
Aggregations