Recreation swift client for each chunk during swift incremental restore
Closes-bug: 1563397 Change-Id: I1b14d6bd09e37c6ca22234141a5d88ccc0be305f
This commit is contained in:
parent
7a3b3bdc3c
commit
4b91ce6d4f
@ -18,6 +18,7 @@ limitations under the License.
|
||||
import json
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
import requests.exceptions
|
||||
import time
|
||||
|
||||
from freezer.storage import base
|
||||
@ -213,8 +214,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
Block a user