Recreation swift client for each chunk during swift incremental restore

Closes-bug: 1563397

Change-Id: I1b14d6bd09e37c6ca22234141a5d88ccc0be305f
(cherry picked from commit 4b91ce6d4f)
This commit is contained in:
eldar nugaev 2016-03-29 16:22:34 +01:00 committed by Pierre-Arthur MATHIEU
parent 427c066eca
commit 5e89fbc501
3 changed files with 14 additions and 4 deletions

View File

@ -451,7 +451,7 @@ def backup_arguments():
backup_args.path_to_backup[:3]
# Freezer version
backup_args.__dict__['__version__'] = '1.2.18'
backup_args.__dict__['__version__'] = '1.2.19'
# todo(enugaev) move it to new command line param backup_media
backup_media = 'fs'

View File

@ -17,6 +17,7 @@ limitations under the License.
import json
import logging
import requests.exceptions
import time
from freezer.storage import base
@ -209,8 +210,17 @@ class SwiftStorage(base.Storage):
:type backup: freezer.storage.base.Backup
:return:
"""
for chunk in self.swift().get_object(
self.container, str(backup), resp_chunk_size=self.chunk_size)[1]:
try:
chunks = self.swift().get_object(
self.container, str(backup),
resp_chunk_size=self.chunk_size)[1]
except requests.exceptions.SSLError as e:
logging.warning(e)
chunks = self.client_manager.create_swift().get_object(
self.container, str(backup),
resp_chunk_size=self.chunk_size)[1]
for chunk in chunks:
yield chunk
def write_backup(self, rich_queue, backup):

View File

@ -1,6 +1,6 @@
[metadata]
name = freezer
version = 1.2.18
version = 1.2.19
author = Freezer Team
author-email = openstack-dev@lists.openstack.org
summary = The OpenStack Backup Restore and Disaster Recovery as a Service Platform