Search in sources :

Example 1 with ViPRTaskMonitor

use of com.emc.sa.engine.ViPRTaskMonitor in project coprhd-controller by CoprHD.

the class InstallOsHelper method installOs.

public void installOs() {
    ExecutionContext context = ExecutionUtils.currentContext();
    List<ViPRTaskMonitor<HostRestRep>> tasks = new ArrayList<>();
    for (HostRestRep host : hostToOsInstall.keySet()) {
        OsInstallParam osInstall = hostToOsInstall.get(host);
        if (osInstall != null) {
            try {
            // tasks.add(ExecutionUtils.startViprTask(new InstallOs(host, osInstall)));
            } catch (ExecutionException e) {
                context.logError("computeutils.installOs.failure", host.getId(), e.getMessage());
            }
        }
    }
    if (!ExecutionUtils.waitForTask(tasks, this)) {
    // TODO: Re-throw the error?
    // ExecutionUtils.checkForError(tasks);
    }
}
Also used : HostRestRep(com.emc.storageos.model.host.HostRestRep) ExecutionContext(com.emc.sa.engine.ExecutionContext) ArrayList(java.util.ArrayList) ViPRTaskMonitor(com.emc.sa.engine.ViPRTaskMonitor) OsInstallParam(com.emc.storageos.model.compute.OsInstallParam) ExecutionException(com.emc.sa.engine.ExecutionException)

Aggregations

ExecutionContext (com.emc.sa.engine.ExecutionContext)1 ExecutionException (com.emc.sa.engine.ExecutionException)1 ViPRTaskMonitor (com.emc.sa.engine.ViPRTaskMonitor)1 OsInstallParam (com.emc.storageos.model.compute.OsInstallParam)1 HostRestRep (com.emc.storageos.model.host.HostRestRep)1 ArrayList (java.util.ArrayList)1