Hi Anil, The sshexec task should fail if the exit status of your remote command 
is not zero. Here is the output from a simple sshexec task where I try to cd to 
a directory that does not exist:

$ ant sshtest
Buildfile: build.xml

sshtest:
  [sshexec] Connecting to localhost:22
  [sshexec] bash: line 1: cd: /poop/poop/poop: No such file or directory

BUILD FAILED
H:\build.xml:56: Remote command failed with exit status 1

Total time: 12 seconds

The outputproperty will capture the ouput from the remote command, not the exit 
status. If you are running a script remotely, just make the script exit with 
the appropriate exit status and your sshexec command will fail if it is not 
zero.

I hope this helps. Tell Barbara and everyone I say Hi.

-Rob Anderson

> -----Original Message-----
> From: Jacob, Anil - MWL [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 26, 2005 2:35 PM
> To: [email protected]
> Subject: Outputproperty in sshexec
> 
> 
> 
> I have an ssh task which executes a remote start command and 
> I am trying
> to get the exit status using outputproperty. However I notice that the
> outputproperty value is not being set. Any Idea's? here is a 
> part of my
> build.
> 
> <sshexec host="${remote.server}" username="${remote.user}"
> keyfile="${user.home}/.ssh/id_dsa" trust="true" command="xxxx"
> outputproperty="step4.out"/>
> <echo message="${step4.out}"/>
> </target>
> 
> <target name="stop.step5" depends="stop.step4">
> <if>
> <equals arg1="${step4.out}" arg2="0" />
> <then>
> <XXXXXX>
> 
> ---
> ${step4.out} is not being set at all. The ssh task executes fine.
> 
> Anil
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to