Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver: remove mktemp tool dependency in ShellDriver #1481

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions labgrid/driver/shelldriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import shlex
import ipaddress
from uuid import uuid4

import attr
from pexpect import TIMEOUT
Expand Down Expand Up @@ -364,10 +365,8 @@ def _target_cleanup(tmpfile):
stream = io.BytesIO(buf)

# We first write to a temp file, which we'll `dd` onto the destination file later
tmpfile = self._run_check('mktemp')
if not tmpfile:
raise ExecutionError('Could not make temporary file on target')
tmpfile = tmpfile[0]
tmpfile = f'/tmp/tmp-{uuid4()}'
self._run_check(f'touch {tmpfile}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about only doing this as a workaround when mktemp fails? Then we can keep using the normal approach for most cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work for me - as a fallback. What are your thoughts about it @jluebbe ?


try:
rx_cmd = self._get_xmodem_rx_cmd(tmpfile)
Expand Down
Loading