Skip to content

Commit

Permalink
Merge pull request #7438 from mvdbeek/fix_shell_runner
Browse files Browse the repository at this point in the history
[18.09] Fix LocalShellRunner
  • Loading branch information
jmchilton committed Mar 1, 2019
2 parents 68e3568 + e8f5a13 commit a12d9e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/jobs/runners/util/cli/shell/local.py
Expand Up @@ -6,6 +6,8 @@
from tempfile import TemporaryFile
from time import sleep

import six

from ..shell import BaseShellExec
from ....util import (
Bunch,
Expand Down Expand Up @@ -37,14 +39,17 @@ class LocalShell(BaseShellExec):
True
>>> exec_result.returncode == TIMEOUT_RETURN_CODE
True
>>> shell.execute('echo hi').stdout == "hi\\n"
True
"""

def __init__(self, **kwds):
pass

def execute(self, cmd, persist=False, timeout=DEFAULT_TIMEOUT, timeout_check_interval=DEFAULT_TIMEOUT_CHECK_INTERVAL, **kwds):
is_cmd_string = isinstance(cmd, six.string_types)
outf = TemporaryFile()
p = Popen(cmd, stdin=None, stdout=outf, stderr=PIPE)
p = Popen(cmd, stdin=None, stdout=outf, stderr=PIPE, shell=is_cmd_string)
# poll until timeout

for i in range(int(timeout / timeout_check_interval)):
Expand Down

0 comments on commit a12d9e3

Please sign in to comment.