Search in sources :

Example 1 with ListHBAInfoCommand

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

the class FindHBAs method executeTask.

@Override
public List<HBAInfo> executeTask() throws Exception {
    List<HBAInfo> results = executeCommand(new ListHBAInfoCommand(), SHORT_TIMEOUT);
    debug("FindHBAs.lookingForWWNs", pwwns);
    Iterator<HBAInfo> iter = results.iterator();
    while (iter.hasNext()) {
        HBAInfo hba = iter.next();
        String wwn = LinuxUtils.normalizeWWN(hba.getWwpn());
        if (!pwwns.contains(wwn)) {
            logDebug("FindHBAs.ignoringHBA", hba);
            iter.remove();
        }
    }
    if (results.isEmpty()) {
        throw stateException("FindHBAs.illegalState.couldNotFindHBAs", pwwns);
    }
    return results;
}
Also used : HBAInfo(com.iwave.ext.linux.model.HBAInfo) ListHBAInfoCommand(com.iwave.ext.linux.command.ListHBAInfoCommand)

Example 2 with ListHBAInfoCommand

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

the class LinuxSystemCLI method listHBAs.

public List<HBAInfo> listHBAs() {
    ListHBAInfoCommand command = new ListHBAInfoCommand();
    executeCommand(command);
    return command.getResults();
}
Also used : ListHBAInfoCommand(com.iwave.ext.linux.command.ListHBAInfoCommand)

Example 3 with ListHBAInfoCommand

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

the class LinuxSystemCLI method rescan.

@Override
public void rescan() throws Exception {
    ListHBAInfoCommand hbaCommand = new ListHBAInfoCommand();
    executeCommand(hbaCommand, SecureShellSupport.SHORT_TIMEOUT);
    RescanHBAsCommand command = new RescanHBAsCommand();
    command.setHbas(hbaCommand.getResults());
    executeCommand(command, SecureShellSupport.SHORT_TIMEOUT);
}
Also used : RescanHBAsCommand(com.iwave.ext.linux.command.RescanHBAsCommand) ListHBAInfoCommand(com.iwave.ext.linux.command.ListHBAInfoCommand)

Aggregations

ListHBAInfoCommand (com.iwave.ext.linux.command.ListHBAInfoCommand)3 RescanHBAsCommand (com.iwave.ext.linux.command.RescanHBAsCommand)1 HBAInfo (com.iwave.ext.linux.model.HBAInfo)1