On Wed, Sep 25, 2013 at 03:48:24PM +0100, Daniel Firth wrote:
+++ b/morphlib/plugins/deploy_plugin.py
@@ -458,6 +458,7 @@ class DeployPlugin(cliapp.Plugin):
self.app.status(msg='Running extension %(name)s%(kind)s',
name=name, kind=kind)
+ os.chdir(repo_dir)
self.app.runcmd(
[ext_filename] + args,
['sh', '-c', 'while read l; do echo `date "+%F
%T"` $l; done'],
It tends to be a bad idea to change the process's current working directory
unless we know for certain that no other part of the program assumes it is
unchanged. With Morph, we don't know that.
runcmd has a cwd=... parameter that can achieve the same effect, but
is less risky to use. It makes the change in the child process, before
execing the actual command.
Thus, -1 for this version of the patch. This is the right place to fix things,
though, it just needs to be done by adding the cwd named parameter to the
self.app.runcmd call.
--
http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/