Commit 84ca59ee authored by Robert Smith's avatar Robert Smith
Browse files

Fixing RemoteAction bug

Moving a bugfix for #295

 from the 2.2.2 branch to 2.2.1.
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent 7f3c549e
package org.eclipse.ice.item.action;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionHostService;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.core.exception.RemoteConnectionException;
......@@ -82,26 +79,17 @@ public abstract class RemoteAction extends Action {
}
if (connectionType != null) {
try {
// Loop over existing connections to see if the user already
// specified
// a connection to the provided host
for (IRemoteConnection c : connectionType
.getConnections()) {
String connectionHost = c
.getService(IRemoteConnectionHostService.class)
.getHostname();
if (InetAddress.getByName(host).getHostAddress()
.equals(InetAddress.getByName(connectionHost)
.getHostAddress())) {
connection = c;
// Found it, return the connection
return connection;
}
// Loop over existing connections to see if the user already
// specified
// a connection to the provided host
for (IRemoteConnection c : connectionType.getConnections()) {
if (host.equals(c.getName())) {
connection = c;
// Found it, return the connection
return connection;
}
} catch (UnknownHostException e) {
logger.error(getClass().getName() + " Exception!", e);
}
// If no connection found, let's ask the user to define it.
......@@ -150,4 +138,4 @@ public abstract class RemoteAction extends Action {
return connection;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment