Fix backups of nameless volumes

Change-Id: I2d1dfb45f816bd38ec2f663c3159b827c46634c9
This commit is contained in:
Pierre-Arthur MATHIEU 2017-03-01 17:01:18 +00:00
parent 9bddd2927c
commit af8e1caaf6
1 changed files with 5 additions and 2 deletions

View File

@ -115,9 +115,12 @@ class BackupOs(object):
stream = client_manager.download_image(image)
package = "{0}/{1}".format(volume_id, utils.DateTime.now().timestamp)
LOG.debug("Uploading image to swift")
if volume.name is None:
name = volume_id
else:
name = volume.name
headers = {'x-object-meta-length': str(len(stream)),
'volume_name': volume.name,
'volume_type': volume.volume_type,
'volume_name': name,
'availability_zone': volume.availability_zone
}
attachments = volume._info['attachments']