Let config override sys.prefix when launching batch commands in subprocess
This commit is contained in:
parent
e608c0b428
commit
df9141ec4e
|
@ -830,7 +830,9 @@ class BatchMasterView(MasterView):
|
||||||
subcommand=None, subcommand_args=None):
|
subcommand=None, subcommand_args=None):
|
||||||
|
|
||||||
# construct command
|
# construct command
|
||||||
cmd = [os.path.join(sys.prefix, 'bin/{}'.format(command))]
|
prefix = self.rattail_config.get('rattail', 'command_prefix',
|
||||||
|
default=sys.prefix)
|
||||||
|
cmd = [os.path.join(prefix, 'bin/{}'.format(command))]
|
||||||
for path in self.rattail_config.files_read:
|
for path in self.rattail_config.files_read:
|
||||||
cmd.extend(['--config', path])
|
cmd.extend(['--config', path])
|
||||||
if username:
|
if username:
|
||||||
|
@ -846,6 +848,7 @@ class BatchMasterView(MasterView):
|
||||||
cmd.extend(subcommand_args)
|
cmd.extend(subcommand_args)
|
||||||
|
|
||||||
# run command in subprocess
|
# run command in subprocess
|
||||||
|
log.debug("launching command in subprocess: %s", cmd)
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
|
|
||||||
def action_subprocess_thread(self, batch_uuid, port, username, action, progress):
|
def action_subprocess_thread(self, batch_uuid, port, username, action, progress):
|
||||||
|
|
Loading…
Reference in a new issue