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:
parent
427c066eca
commit
5e89fbc501
|
@ -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'
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue