3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-01 15:49:49 +01:00

auto-t: simplify copy_to_hotspot

Since copy_to_storage can take an arbitrary destination path now
we can reuse that instead of duplicating code.
This commit is contained in:
James Prestwood 2020-11-04 08:48:09 -08:00 committed by Denis Kenzior
parent efe53e28c8
commit 2d45461dfd

View File

@ -1055,14 +1055,10 @@ class IWD(AsyncOpAbstract):
@staticmethod @staticmethod
def copy_to_hotspot(source): def copy_to_hotspot(source):
import shutil
assert not os.path.isabs(source)
if not os.path.exists(IWD_STORAGE_DIR + "/hotspot"): if not os.path.exists(IWD_STORAGE_DIR + "/hotspot"):
os.mkdir(IWD_STORAGE_DIR + "/hotspot") os.mkdir(IWD_STORAGE_DIR + "/hotspot")
shutil.copy(source, IWD_STORAGE_DIR + "/hotspot") IWD.copy_to_storage(source, IWD_STORAGE_DIR + "/hotspot")
@staticmethod @staticmethod
def copy_to_ap(source): def copy_to_ap(source):