 <p>The problem was that the below variables initialization code was never getting executed:</p> <pre><code>env.shell = '/bin/ksh' env.user = config.user_app2 env.password = config.password_app2 </code></pre> <p>Creating an init function that had the above lines and running that function before any others like execute() worked. </p>