comparison scriptrunner.py @ 8:1b7f987270a6 draft

planemo upload for repository https://github.com/mvdbeek/docker_scriptrunner/ commit 87a8f2ec706b231b2db20a9433efa34d967d35cf
author mvdbeek
date Fri, 08 Jul 2016 18:10:00 -0400
parents 17e93298c225
children 77dca93454b7
comparison
equal deleted inserted replaced
7:17e93298c225 8:1b7f987270a6
392 """ 392 """
393 cmd = ["/usr/sbin/usermod", "-u", new_id, "galaxy"] 393 cmd = ["/usr/sbin/usermod", "-u", new_id, "galaxy"]
394 subprocess.call(cmd) 394 subprocess.call(cmd)
395 395
396 396
397 def update_permissions(new_id,new_gid): 397 def update_permissions():
398 cmd1 = ['/usr//bin/find', '/', '-user', '1450', '-exec', 'chown', '-h', new_id, '{}', '\\;'] 398 cmd = ["/bin/chown", "-R", "galaxy:galaxy", "/var/home/galaxy"]
399 cmd2 = ['/usr//bin/find', '/', '-group', '1450', '-exec', 'chgrp', '-h', new_gid, '{}', '\\;'] 399 subprocess.call(cmd)
400 #cmd = ["/bin/chown", "-R", "galaxy:galaxy", "/var/home/galaxy"]
401 subprocess.call(cmd1)
402 subprocess.call(cmd2)
403 400
404 def main(): 401 def main():
405 u = """ 402 u = """
406 This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as: 403 This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as:
407 <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript" 404 <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript"
440 return 437 return
441 change_user_id(opts.user_id) 438 change_user_id(opts.user_id)
442 change_group_id(opts.group_id) 439 change_group_id(opts.group_id)
443 os.setgid(int(opts.group_id)) 440 os.setgid(int(opts.group_id))
444 os.setuid(int(opts.user_id)) 441 os.setuid(int(opts.user_id))
445 update_permissions(opts.user_id, opts.group_id) 442 update_permissions()
446 r = ScriptRunner(opts) 443 r = ScriptRunner(opts)
447 retcode = r.run() 444 retcode = r.run()
448 os.unlink(r.sfile) 445 os.unlink(r.sfile)
449 if retcode: 446 if retcode:
450 sys.exit(retcode) # indicate failure to job runner 447 sys.exit(retcode) # indicate failure to job runner