use of com.iwave.ext.linux.command.powerpath.PowerPathException 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