Merge "lvm backup: calculate path_to_backup after volume is mounted"

This commit is contained in:
Zuul 2018-10-25 07:28:16 +00:00 committed by Gerrit Code Review
commit 7c4eb63c6f
1 changed files with 6 additions and 3 deletions

View File

@ -115,9 +115,6 @@ def lvm_snap(backup_opt_dict):
"{0}/mount_{1}".format(freezer_config.DEFAULT_LVM_MOUNT_BASEDIR,
lvm_uuid)
backup_opt_dict.path_to_backup = os.path.join(backup_opt_dict.lvm_dirmount,
lvm_info['snap_path'])
if not validate_lvm_params(backup_opt_dict):
LOG.info('No LVM requested/configured')
return False
@ -186,6 +183,12 @@ def lvm_snap(backup_opt_dict):
'Volume {0} successfully mounted on {1}'.format(
abs_snap_name, backup_opt_dict.lvm_dirmount))
# After snapshot is mounted, adjust path_to_backup according the mount
# point and relative path of the snapshot volume.
lvm_info = get_lvm_info(backup_opt_dict.path_to_backup)
backup_opt_dict.path_to_backup = os.path.join(backup_opt_dict.lvm_dirmount,
lvm_info['snap_path'])
return True