script audiogen respects TMPDIR

This commit is contained in:
boyska 2016-08-23 17:15:09 +02:00
parent 162dac71b0
commit 4b34670557
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -49,12 +49,16 @@ def generate(spec):
os.getuid()))
try:
log.info('Going to run {}'.format([scriptpath] + args))
env = dict(
HOME=os.environ['HOME'],
PATH=os.environ['PATH'],
MPD_HOST=conf['MPD_HOST'],
MPD_PORT=str(conf['MPD_PORT'])
)
if 'TMPDIR' in os.environ:
env['TMPDIR'] = os.environ['TMPDIR']
out = subprocess.check_output([scriptpath] + args,
env=dict(
HOME=os.environ['HOME'],
PATH=os.environ['PATH'],
MPD_HOST=conf['MPD_HOST'],
MPD_PORT=str(conf['MPD_PORT'])),
env=env,
cwd='/')
except subprocess.CalledProcessError as exc:
log.error("Error %d when running script %s" %