Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ricleal committed Dec 8, 2016
1 parent 64d2cb2 commit 245e2f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 11 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ Then use it in a project::
port=22,
)[0]
interpreter = Interpreter.objects.get_or_create(
name = 'python',
path = '/usr/bin/python -u',
python2_interpreter = Interpreter.objects.get_or_create(
name = 'python2',
path = '/usr/bin/python2.7 -u',
)[0]
server.interpreters.set([interpreter])
python3_interpreter = Interpreter.objects.get_or_create(
name = 'python3',
path = '/usr/bin/python3.5 -u',
)[0]

server.interpreters.set([python2_interpreter,
python3_interpreter])

job = Job.objects.get_or_create(
title='My Job Title',
Expand All @@ -47,7 +53,7 @@ Then use it in a project::
remote_filename='test.py',
owner=request.user,
server=server,
interpreter=interpreter,
interpreter=python2_interpreter,
)[0]

modified_files = submit_job_to_server(
Expand Down
8 changes: 3 additions & 5 deletions django_remote_submission/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,16 @@ def submit_job_to_server(job_pk, password, username=None, client=None,
command = '{} {}'.format(job.interpreter.path,job.remote_filename)
if timeout is not None:
command = 'timeout {}s {}'.format(timeout.total_seconds(), command)
return command

logger.debug("Executing remotely the command: %s.", command)

stdin, stdout, stderr = client.exec_command(
command='cd {} && {}'.format(
command='mkdir -p {0} && cd {0} && {1}'.format(
job.remote_directory,
command,
),
bufsize=1,
)

logger.debug("Executed remotely the command: %s.", command)

channel = stdin.channel

# In parallel creates logs for both stdout and stderr
Expand Down

0 comments on commit 245e2f9

Please sign in to comment.