commit | cfa9f0b9a10504fc3eb585550ced58d4c83a8453 | [log] [tgz] |
---|---|---|
author | Patrick Georgi <pgeorgi@google.com> | Wed Nov 18 15:22:29 2020 +0100 |
committer | Commit Bot <commit-bot@chromium.org> | Sat Nov 21 12:40:26 2020 +0000 |
tree | cfbfe4a25116be0ade2a13857b21d570bed0f6b4 | |
parent | 9653a40df93c90eb3365b9c0182ab4cc05007d2b [diff] |
faft: Allow creating temporary directories that survive a reboot mkdtemp can set up temporary directories in non-default directories. Expose that functionality. BUG=none TEST=change I5db5950cf4efcb1f4419532b3eda3e6c1e2aed9c successfully uses this function. Change-Id: I8c5d2761850c56a41155ab93c559f4132ce0bed3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2545831 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Brent Peterson <brentpeterson@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
diff --git a/client/cros/faft/rpc_functions.py b/client/cros/faft/rpc_functions.py index 0515c14..0ae5f28 100644 --- a/client/cros/faft/rpc_functions.py +++ b/client/cros/faft/rpc_functions.py
@@ -945,9 +945,9 @@ root_part = self._os_if.get_root_part() return self._os_if.get_internal_disk(root_part) - def create_temp_dir(self, prefix='backup_'): + def create_temp_dir(self, prefix='backup_', dir=None): """Create a temporary directory and return the path.""" - return tempfile.mkdtemp(prefix=prefix) + return tempfile.mkdtemp(prefix=prefix, dir=dir) def remove_file(self, file_path): """Remove the file."""