Search in sources :

Example 1 with MountCommand

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);
}
Also used : MountCommand(com.iwave.ext.linux.command.MountCommand)

Example 2 with MountCommand

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);
}
Also used : MountCommand(com.iwave.ext.linux.command.MountCommand)

Example 3 with MountCommand

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;
        }
    }
}
Also used : ComputeSystemControllerException(com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException) MountCommand(com.iwave.ext.linux.command.MountCommand) CommandOutput(com.iwave.ext.command.CommandOutput) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) ComputeSystemControllerException(com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException)

Aggregations

MountCommand (com.iwave.ext.linux.command.MountCommand)3 ComputeSystemControllerException (com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 CommandOutput (com.iwave.ext.command.CommandOutput)1