use of com.iwave.ext.linux.command.MultipathCommand in project coprhd-controller by CoprHD.
the class CheckForMultipath method executeTask.
@Override
public String executeTask() throws Exception {
MultipathCommand command = new MultipathCommand();
command.addArgument("-l");
try {
executeCommand(command, SHORT_TIMEOUT);
CommandOutput output = command.getOutput();
if (output.getExitValue() != 0) {
return getMessage("CheckForMultipath.noMultipath");
}
return null;
} catch (Exception e) {
return e.getMessage();
}
}
use of com.iwave.ext.linux.command.MultipathCommand in project coprhd-controller by CoprHD.
the class LinuxHostDiscoveryAdapter method checkMultipathSoftwareCompatibility.
private void checkMultipathSoftwareCompatibility(Host host) {
LinuxSystemCLI cli = createLinuxCLI(host);
String powerpathMessage = null;
String multipathMessage = null;
try {
PowermtCheckRegistrationCommand command = new PowermtCheckRegistrationCommand();
cli.executeCommand(command, SecureShellSupport.SHORT_TIMEOUT);
// powerpath is installed
LOG.info("PowerPath is installed");
return;
} catch (PowerPathException e) {
powerpathMessage = e.getMessage();
LOG.info("PowerPath is unavailable: " + powerpathMessage);
} catch (Exception e) {
LOG.info("Error while checking for powerpath: " + e.getMessage(), e);
}
try {
MultipathCommand command = new MultipathCommand();
command.addArgument("-l");
cli.executeCommand(command, SecureShellSupport.SHORT_TIMEOUT);
// multipath is installed
LOG.info("Multipath is installed");
return;
} catch (MultipathException e) {
multipathMessage = e.getMessage();
LOG.info("Multipath is unavailable: " + multipathMessage);
} catch (Exception e) {
LOG.info("Error while checking for multipath: " + e.getMessage(), e);
}
throw new CompatibilityException("No multipath software available: \n" + powerpathMessage + "\n" + multipathMessage);
}
Aggregations