Ok. I'm going with this for the time being...
class DebugScriptDeployment(ScriptDeployment):
def run(self, node, client):
o = ScriptDeployment.run(self, node, client)
sys.stdout.write(self.stdout)
sys.stderr.write(self.stderr)
if self.exit_status != 0:
die("*** FATAL.")
return o
Thanks Tomaž and Paul.
P.S. Any chance of getting stderr & stdout as streams?
On 08/11/2010, at 12:46 PM, Paul Querna wrote:
> sd = ScriptDeployment(...)
> .... # run it
>
> print sd.stdout
> print sd.stderr
> print sd.exit_status
>
> All work in 0.4.0.
>
> They are just not documented. (we should fix that :) )
>
> 2010/11/7 Tomaž Muraus <[email protected]>:
>> Hello,
>>
>> Currently only the https/https connection logging is available if you set
>> the LIBCLOUD_DEBUG environment variable.
>>
>> Deployment stdout and stderr is currently not logged, but you can access it
>> by sub-classing the ScriptDeployment and overriding the run method (stdout
>> is available in the self.stdout variable and stderr in self.stderr).
>>
>> On Mon, Nov 8, 2010 at 2:15 AM, Mark Nottingham <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I've just started to play with libcloud, to replace a mass of shell scripts
>>> I've been using to bring hosts up.
>>>
>>> So far so good, but AFAICT the output of ScriptDeployment() isn't made
>>> available anywhere; this would be useful for debugging, testing, and just
>>> generally seeing what the hell is going on. Is it available, or is this a
>>> feature request?
>>>
>>> Cheers,
>>>
>>> P.S. Documenting the requirement for paramiko somewhere would be helpful.
>>>
>>> --
>>> Mark Nottingham http://www.mnot.net/
>>>
>>>
>>>
>>>
>>
--
Mark Nottingham http://www.mnot.net/