3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

auto-t: iwd.py: allow renaming in copy_to_storage

By providing a 'name' keyword argument the file copied will be
renamed to that.
This commit is contained in:
James Prestwood 2021-08-13 12:55:06 -07:00 committed by Denis Kenzior
parent 78f5a5dde4
commit 3adb91fc9e

View File

@ -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