From 1ec501a1710f244ec88afa40649bd104e65762df Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 16 Jan 2019 12:37:26 -0600 Subject: [PATCH] don't use distutils.copy_file, but instead shutil.copy --- Dell/recovery_backend.py | 10 +++------- Dell/recovery_common.py | 5 +---- debian/control | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Dell/recovery_backend.py b/Dell/recovery_backend.py index 795d7606..2195f245 100644 --- a/Dell/recovery_backend.py +++ b/Dell/recovery_backend.py @@ -36,7 +36,6 @@ import tarfile import shutil import datetime -import distutils.dir_util import lsb_release from hashlib import md5 @@ -374,8 +373,7 @@ def _process_driver_fish(self, driver_fish, assembly_tmp): if dest is not None: if not os.path.isdir(dest): os.makedirs(dest) - distutils.file_util.copy_file(fishie, dest, - verbose=1, update=0) + shutil.copy(fishie, dest) def start_sizable_progress_thread(self, input_str, mnt, w_size): @@ -480,9 +478,7 @@ def assemble_image(self, new_name += '.zip' elif os.path.exists(fishie) and tarfile.is_tarfile(fishie): new_name += '.tgz' - distutils.file_util.copy_file(fishie, - os.path.join(dest, new_name), - verbose=1, update=0) + shutil.copy_file(fishie, os.path.join(dest, new_name)) #If dell-recovery needs to be injected into the image if dell_recovery_package: @@ -497,7 +493,7 @@ def assemble_image(self, (out, err) = call.communicate() else: logging.debug("Adding manually included dell-recovery package, %s", dell_recovery_package) - distutils.file_util.copy_file(dell_recovery_package, dest) + shutil.copy(dell_recovery_package, dest) function = getattr(Backend, create_fn) function(self, assembly_tmp, version, iso, platform, no_update) diff --git a/Dell/recovery_common.py b/Dell/recovery_common.py index 6bcb6a76..866c33bd 100644 --- a/Dell/recovery_common.py +++ b/Dell/recovery_common.py @@ -92,8 +92,6 @@ def white_tree(action, whitelist, src, dst='', base=None): def _tree(action, list, src, dst, base, white): """Helper function for tree calls""" - from distutils.file_util import copy_file - if base is None: base = src if not base.endswith('/'): @@ -131,8 +129,7 @@ def _tree(action, list, src, dst, base, white): if action == "copy": if not os.path.isdir(dst): os.makedirs(dst) - copy_file(src_name, dst_name, preserve_mode=1, - preserve_times=1, update=1, dry_run=0) + shtuil.copy(src_name, dst_name) outputs.append(dst_name) elif action == "size": diff --git a/debian/control b/debian/control index 565bb13c..9401f0f9 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,6 @@ Depends: ${python3:Depends}, python3-apt, python3-dbus, python3-debian, - python3-distutils, python3-gi, udisks2, uuid-runtime,