aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Pontes2011-09-19 05:52:10 (EDT)
committerAnithra P Janakiraman2011-09-19 05:53:14 (EDT)
commit104be8caedb2f54a28a716d86803beb817101ea1 (patch)
tree63387b37b18fd143b9952e7c0925e995fdcb75ad
parent57f4406257bd1f361a7bc2ebf1fa67d338220761 (diff)
downloadorg.eclipse.linuxtools-104be8caedb2f54a28a716d86803beb817101ea1.zip
org.eclipse.linuxtools-104be8caedb2f54a28a716d86803beb817101ea1.tar.gz
org.eclipse.linuxtools-104be8caedb2f54a28a716d86803beb817101ea1.tar.bz2
Fix Bug #351477
When SystemTap script is run with 'run w/Graph' option and the connection to remote host fails the wizard to continue with creation of graph appears in spite of the error message/failure https://bugs.eclipse.org/bugs/show_bug.cgi?id=351477 * systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java * systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java12
2 files changed, 10 insertions, 11 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java
index ce31d97..a8056ea 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java
@@ -12,11 +12,11 @@ import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPref
import java.io.*;
@SuppressWarnings("deprecation")
-public class ScpClient{
+public class ScpClient {
private Session session;
- public ScpClient() {
+ public ScpClient() throws Exception {
//public static void main(String[] arg){
@@ -43,10 +43,11 @@ public class ScpClient{
{
e.printStackTrace(System.err);
new ErrorMessage("Error in connection", "File Transfer failed.\n See stderr for more details").open();
+ throw e;
}
}
- public void transfer(String fromFile, String toFile) {
+ public void transfer(String fromFile, String toFile) throws Exception {
// exec 'scp -t rfile' remotely
FileInputStream fis=null;
String rfile=toFile;
@@ -109,7 +110,7 @@ public class ScpClient{
}
catch(Exception e){
try{if(fis!=null)fis.close();}catch(Exception ee){}
-
+ throw e;
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java
index 3ee2175..19db18b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/src/org/eclipse/linuxtools/systemtap/ui/graphicalrun/actions/RunScriptChartAction.java
@@ -81,15 +81,13 @@ public class RunScriptChartAction extends RunScriptAction implements IWorkbenchW
serverfileName = fileName.substring(fileName.lastIndexOf('/')+1);
tmpfileName="/tmp/"+ serverfileName;
scpclient.transfer(fileName,tmpfileName);
- }catch(Exception e){e.printStackTrace();}
-
- String[] script = buildScript();
-
- String[] envVars = getEnvironmentVariables();
-
-
+ }catch(Exception e){ continueRun = false;}
+ String[] script = null;
+
+ if(continueRun) script = buildScript();
if(continueRun) {
//createClientSession();
+ String[] envVars = getEnvironmentVariables();
ScriptConsole console = ScriptConsole.getInstance(serverfileName);
console.run(script, envVars, new PasswordPrompt(IDESessionSettings.password), new StapErrorParser());