From 3adb91fc9e7efdcd37025a5396526fa71cf9f931 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 13 Aug 2021 12:55:06 -0700 Subject: [PATCH] auto-t: iwd.py: allow renaming in copy_to_storage By providing a 'name' keyword argument the file copied will be renamed to that. --- autotests/util/iwd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 36b8f6f9..737b2beb 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -1152,11 +1152,14 @@ class IWD(AsyncOpAbstract): fo.close() @staticmethod - def copy_to_storage(source, storage_dir=IWD_STORAGE_DIR): + def copy_to_storage(source, storage_dir=IWD_STORAGE_DIR, name=None): import shutil assert not os.path.isabs(source) + if name: + storage_dir += '/%s' % name + shutil.copy(source, storage_dir) @staticmethod