[PATCH] Fix RT #116 add timestamps to deploy messages

Richard Maw richard.maw at codethink.co.uk
Mon Jun 17 14:35:18 BST 2013


On Mon, Jun 17, 2013 at 10:05:43AM +0100, Richard Dale wrote:
> ---
>  morphlib/writeexts.py |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py
> index df4cec3..8fcf39d 100644
> --- a/morphlib/writeexts.py
> +++ b/morphlib/writeexts.py
> @@ -47,7 +47,8 @@ class WriteExtension(cliapp.Application):
>          
>          '''
>          
> -        self.output.write('%s\n' % (kwargs['msg'] % kwargs))
> +        timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime())        
> +        self.output.write('%s %s\n' % (timestamp, kwargs['msg'] % kwargs))
>      
>      def create_local_system(self, temp_root, raw_disk):
>          '''Create a raw system image locally.'''

Unfortunately I think this is the wrong solution. Write extensions can
be any form of executable. tar.write is a shell script.

I would try morphlib/plugins/deploy_plugin.py. DeployPlugin._run_extension
looks like a good place to start.



More information about the baserock-dev mailing list