Using the InputStream in Launcher.launch()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using the InputStream in Launcher.launch()

Erik Ramfelt
Im wondering if anyone used the feature to send in commands using the
InputStream parameter when executing a command? Ive searched the cvs
but couldnt find any examples.

The problem Im having now is that the 'cleartool' command stops while
executing a certain command ('setcs') and is expecting an answer on a
question. It is not possible to make cleartool to ignore it.
Currently, the CC plugin does a launch().join() so the answer will not
be answered and an exception is thrown because of the exit code 1.

What would be the best way to send in a "yes", if I would like the
plugin to answer the question?


Example console output is logged in
https://hudson.dev.java.net/issues/show_bug.cgi?id=1051

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Using the InputStream in Launcher.launch()

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:

> Im wondering if anyone used the feature to send in commands using the
> InputStream parameter when executing a command? Ive searched the cvs
> but couldnt find any examples.
>
> The problem Im having now is that the 'cleartool' command stops while
> executing a certain command ('setcs') and is expecting an answer on a
> question. It is not possible to make cleartool to ignore it.
> Currently, the CC plugin does a launch().join() so the answer will not
> be answered and an exception is thrown because of the exit code 1.
>
> What would be the best way to send in a "yes", if I would like the
> plugin to answer the question?
You can seed the byte array that has the 'yes', and then pass that as
ByteArrayInputStream to the launch method that takes InputStream.

This is used for example to launch a remote slave agent, so I know it works.


>
>
> Example console output is logged in
> https://hudson.dev.java.net/issues/show_bug.cgi?id=1051
>
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment