Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2015-06-08 21:11:54 -0400
committerJeff Johnston2015-06-08 22:13:11 -0400
commitc38204767841173d73958cf7b06561f437b934da (patch)
tree9ac35571d5e75e14476509b995a54145f05debab
parentf7a10b4ee5ca1f9abc540a6db7d81201e4fb421c (diff)
downloadorg.eclipse.linuxtools-c38204767841173d73958cf7b06561f437b934da.tar.gz
org.eclipse.linuxtools-c38204767841173d73958cf7b06561f437b934da.tar.xz
org.eclipse.linuxtools-c38204767841173d73958cf7b06561f437b934da.zip
Make some last minute fixes based on test Docker Tooling
- fix DockerConnection to add null check for outputStream in LoggingThread finally clause - fix RemoveContainersCommandHandler to use the container name when issuing an error message Change-Id: I264c12c702cf7ae868511329fd7a1f88cc5d551f Reviewed-on: https://git.eclipse.org/r/49716 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com> (cherry picked from commit 6f8b0a135d22a4a89992faae1fefe9cb430d27a3) Reviewed-on: https://git.eclipse.org/r/49718
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java9
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java2
2 files changed, 6 insertions, 5 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index a37b6b058f..842aa3eb7d 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -39,9 +39,6 @@ import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
-import jnr.unixsocket.UnixSocketAddress;
-import jnr.unixsocket.UnixSocketChannel;
-
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
@@ -101,6 +98,9 @@ import com.spotify.docker.client.messages.Info;
import com.spotify.docker.client.messages.PortBinding;
import com.spotify.docker.client.messages.Version;
+import jnr.unixsocket.UnixSocketAddress;
+import jnr.unixsocket.UnixSocketChannel;
+
/**
* A connection to a Docker daemon. The connection may rely on Unix Socket or TCP connection (using the REST API).
* All low-level communication is delegated to a wrapped {@link DockerClient}.
@@ -799,7 +799,8 @@ public class DockerConnection implements IDockerConnection {
} finally {
follow = false;
copyClient.close(); // we are done with copyClient..dispose
- outputStream.close();
+ if (outputStream != null)
+ outputStream.close();
}
}
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java
index ded30596ec..5f5aa1326b 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java
@@ -42,7 +42,7 @@ public class RemoveContainersCommandHandler extends BaseContainersCommandHandler
connection.removeContainer(container.id());
} catch (DockerException | InterruptedException e) {
final String errorMessage = DVMessages.getFormattedString(
- CONTAINER_REMOVE_ERROR_MSG, container.id().substring(0, 8));
+ CONTAINER_REMOVE_ERROR_MSG, container.name());
openError(errorMessage, e);
} finally {
// always get images as we sometimes get errors on intermediate

Back to the top