Mercurial > repos > mvdbeek > docker_scriptrunner
comparison scriptrunner.py @ 10:ed7cf3f35799 draft
planemo upload for repository https://github.com/mvdbeek/docker_scriptrunner/ commit d8d8e8e063698813c9eb646e0df7d93118fd0520
author | mvdbeek |
---|---|
date | Sat, 09 Jul 2016 07:12:40 -0400 |
parents | 77dca93454b7 |
children | 5a3652633289 |
comparison
equal
deleted
inserted
replaced
9:77dca93454b7 | 10:ed7cf3f35799 |
---|---|
335 if self.opts.output_dir: | 335 if self.opts.output_dir: |
336 ste = open(self.elog,'w') | 336 ste = open(self.elog,'w') |
337 sto = open(self.tlog,'w') | 337 sto = open(self.tlog,'w') |
338 sto.write('## Toolfactory generated command line = %s\n' % ' '.join(self.cl)) | 338 sto.write('## Toolfactory generated command line = %s\n' % ' '.join(self.cl)) |
339 sto.flush() | 339 sto.flush() |
340 print("commandline is %s" % (self.cl)) | |
341 print("environment is %s" % (os.environ)) | |
342 p = subprocess.Popen(self.cl,shell=False,stdout=sto,stderr=ste,stdin=subprocess.PIPE,cwd=self.opts.output_dir) | 340 p = subprocess.Popen(self.cl,shell=False,stdout=sto,stderr=ste,stdin=subprocess.PIPE,cwd=self.opts.output_dir) |
343 else: | 341 else: |
344 p = subprocess.Popen(self.cl,shell=False,stdin=subprocess.PIPE) | 342 p = subprocess.Popen(self.cl,shell=False,stdin=subprocess.PIPE) |
345 p.stdin.write(self.script) | 343 p.stdin.write(self.script) |
346 p.stdin.close() | 344 p.stdin.close() |
380 To avoid issues with wrong user ids, we change the user id of the 'galaxy' user in the container | 378 To avoid issues with wrong user ids, we change the user id of the 'galaxy' user in the container |
381 to the user id with which the script has been called initially. | 379 to the user id with which the script has been called initially. |
382 """ | 380 """ |
383 cmd1 = ["/usr/sbin/usermod", "-d", "/var/home/galaxy", "galaxy"] | 381 cmd1 = ["/usr/sbin/usermod", "-d", "/var/home/galaxy", "galaxy"] |
384 cmd2 = ["/usr/sbin/usermod", "-u", new_uid, "galaxy"] | 382 cmd2 = ["/usr/sbin/usermod", "-u", new_uid, "galaxy"] |
385 cmd3 = ["/usr/sbin/groupmod", "-g", "1450", new_gid] | 383 cmd3 = ["/usr/sbin/groupmod", "-g", new_gid, "galaxy"] |
386 cmd4 = ["/usr/sbin/usermod", "-d", "/home/galaxy", "galaxy"] | 384 cmd4 = ["/usr/sbin/usermod", "-d", "/home/galaxy", "galaxy"] |
387 [subprocess.call(cmd) for cmd in [cmd1, cmd2, cmd3, cmd4]] | 385 [subprocess.call(cmd) for cmd in [cmd1, cmd2, cmd3, cmd4]] |
388 | 386 |
389 | 387 |
390 def main(): | 388 def main(): |