From 8574ca26c5c13f34936c00dc585b9c34e700a5cf Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Thu, 17 Sep 2015 15:03:55 +0200 Subject: [PATCH] Detect multiple machines configuration before connecting to vm (PY-11731). --- .../src/com/intellij/remote/VagrantSupport.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/remote/VagrantSupport.java b/platform/platform-impl/src/com/intellij/remote/VagrantSupport.java index d941d4e154be..898aaacd2468 100644 --- a/platform/platform-impl/src/com/intellij/remote/VagrantSupport.java +++ b/platform/platform-impl/src/com/intellij/remote/VagrantSupport.java @@ -37,8 +37,9 @@ public abstract class VagrantSupport { public static VagrantSupport getInstance() { return ServiceManager.getService(VagrantSupport.class); } - - public abstract ListenableFuture computeVagrantSettings(@Nullable Project project, @NotNull String vagrantFolder, @Nullable String machineName); + public abstract ListenableFuture computeVagrantSettings(@Nullable Project project, + @NotNull String vagrantFolder, + @Nullable String machineName); public static void showMissingVagrantSupportMessage(final @Nullable Project project) { UIUtil.invokeLaterIfNeeded(new Runnable() { @@ -64,12 +65,17 @@ public abstract class VagrantSupport { public abstract List getMachineNames(@NotNull String instanceFolder); public boolean isNotReadyForSsh(Throwable t) { - return t.getMessage().contains("not yet ready for SSH"); + return isNotReadyForSsh(t.getMessage()); + } + + public static boolean isNotReadyForSsh(@NotNull String errorMessage) { + return errorMessage.contains("not yet ready for SSH"); } @Nullable public abstract String findVagrantFolder(@NotNull Project project); - public static class MultipleMachinesException extends Exception {} + public static class MultipleMachinesException extends Exception { + } }