Updated backup.py

This commit is contained in:
2Shirt 2018-12-27 19:42:58 -07:00
parent 36e419bca0
commit a269859b17
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -14,7 +14,8 @@ REGEX_BAD_PATH_NAMES = re.compile(
def backup_partition(disk, par):
"""Create a backup image of a partition."""
if par.get('Image Exists', False) or par['Number'] in disk['Bad Partitions']:
if (par.get('Image Exists', False)
or par['Number'] in disk['Bad Partitions']):
raise GenericAbort
cmd = [
@ -151,7 +152,10 @@ def select_backup_destination(auto_select=True):
# Add local disks
for d in psutil.disk_partitions():
if re.search(r'^{}'.format(global_vars['Env']['SYSTEMDRIVE']), d.mountpoint, re.IGNORECASE):
if re.search(
r'^{}'.format(global_vars['Env']['SYSTEMDRIVE']),
d.mountpoint,
re.IGNORECASE):
# Skip current OS drive
pass
elif 'fixed' in d.opts:
@ -203,3 +207,5 @@ def verify_wim_backup(partition):
if __name__ == '__main__':
print("This file is not meant to be called directly.")
# vim: sts=2 sw=2 ts=2