Remove redundant initialization of swift client

When using ssh, local or s3 storage, freezer do not need do the
initialization of swift client in the process of creating image.

Change-Id: I5280d3e97bed7f2c488acc2ed6bd2befe1f21b88
Closes-Bug: #1705603
This commit is contained in:
Pengju Jiao 2017-07-21 19:48:56 +08:00
parent 1427e34c3a
commit 55d6645b07
1 changed files with 1 additions and 1 deletions

View File

@ -90,9 +90,9 @@ class RestoreOs(object):
:type restore_from_timestamp: int
:return:
"""
swift = self.client_manager.get_swift()
backup = self._get_backups(path, restore_from_timestamp)
if self.storage.type == 'swift':
swift = self.client_manager.get_swift()
path = "{0}_segments/{1}/{2}".format(self.container, path, backup)
stream = swift.get_object(self.container,
"{}/{}".format(path, backup),