Skip to content

Commit

Permalink
don't use distutils.copy_file, but instead shutil.copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Limonciello committed Jan 25, 2019
1 parent f9af43f commit 1ec501a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
10 changes: 3 additions & 7 deletions Dell/recovery_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import tarfile
import shutil
import datetime
import distutils.dir_util
import lsb_release
from hashlib import md5

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions Dell/recovery_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('/'):
Expand Down Expand Up @@ -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":
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Depends: ${python3:Depends},
python3-apt,
python3-dbus,
python3-debian,
python3-distutils,
python3-gi,
udisks2,
uuid-runtime,
Expand Down

0 comments on commit 1ec501a

Please sign in to comment.