Search in sources :

Example 1 with ListMountPointsCommand

use of com.iwave.ext.linux.command.ListMountPointsCommand in project coprhd-controller by CoprHD.

the class FindMountPointsForVolumes method executeTask.

@Override
public Void executeTask() throws Exception {
    ListMountPointsCommand command = new ListMountPointsCommand();
    Map<String, MountPoint> results = executeCommand(command, SHORT_TIMEOUT);
    for (VolumeSpec volume : volumes) {
        volume.mountPoint = LinuxUtils.getMountPoint(hostId, results, volume.viprVolume);
    }
    return null;
}
Also used : ListMountPointsCommand(com.iwave.ext.linux.command.ListMountPointsCommand) MountPoint(com.iwave.ext.linux.model.MountPoint) VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)

Example 2 with ListMountPointsCommand

use of com.iwave.ext.linux.command.ListMountPointsCommand in project coprhd-controller by CoprHD.

the class LinuxSystemCLI method listMountPoints.

public List<MountPoint> listMountPoints() {
    ListMountPointsCommand command = new ListMountPointsCommand();
    executeCommand(command);
    return Lists.newArrayList(command.getResults().values());
}
Also used : ListMountPointsCommand(com.iwave.ext.linux.command.ListMountPointsCommand)

Example 3 with ListMountPointsCommand

use of com.iwave.ext.linux.command.ListMountPointsCommand in project coprhd-controller by CoprHD.

the class LinuxMountUtils method verifyMountPoints.

public boolean verifyMountPoints(String mountPoint, String mountPath) throws InternalException {
    ListMountPointsCommand command = new ListMountPointsCommand();
    _log.info("check existing command:" + command.getResolvedCommandLine());
    cli.executeCommand(command);
    Map<String, MountPoint> mountPoints = command.getResults();
    for (MountPoint mp : mountPoints.values()) {
        if (StringUtils.equals(mp.getDevice(), mountPoint) && StringUtils.equals(mp.getPath(), mountPath)) {
            return true;
        }
    }
    return false;
}
Also used : ListMountPointsCommand(com.iwave.ext.linux.command.ListMountPointsCommand) MountPoint(com.iwave.ext.linux.model.MountPoint)

Example 4 with ListMountPointsCommand

use of com.iwave.ext.linux.command.ListMountPointsCommand in project coprhd-controller by CoprHD.

the class LinuxMountUtils method checkExistingMountPoints.

protected void checkExistingMountPoints(String mountPoint) throws InternalException {
    ListMountPointsCommand command = new ListMountPointsCommand();
    _log.info("check existing command:" + command.getResolvedCommandLine());
    cli.executeCommand(command);
    Map<String, MountPoint> mountPoints = command.getResults();
    for (MountPoint mp : mountPoints.values()) {
        if (StringUtils.equals(mp.getPath(), mountPoint)) {
            throw new IllegalStateException("Mount point already exists: " + mountPoint);
        }
    }
}
Also used : ListMountPointsCommand(com.iwave.ext.linux.command.ListMountPointsCommand) MountPoint(com.iwave.ext.linux.model.MountPoint)

Aggregations

ListMountPointsCommand (com.iwave.ext.linux.command.ListMountPointsCommand)4 MountPoint (com.iwave.ext.linux.model.MountPoint)3 VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)1