Fix restore cinder volume error

When doing restore of cinder volume from specify swift
container named 'freezer/prefix', it will fail because
the wrong usage of swift client. 'freezer' should be
container name, 'prefix' should be object prefix.

Change-Id: Ib9a8092ac9afb3e3867be91501a198d1ab867efc
Closes-Bug:#1714170
This commit is contained in:
Pengju Jiao 2017-08-31 14:46:58 +08:00
parent a048ccbac4
commit b2a1b57141
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ class RestoreOs(object):
if self.storage.type == "swift":
swift = self.client_manager.get_swift()
path = "{0}_segments/{1}/".format(self.container, path)
info, backups = swift.get_container(self.container, prefix=path)
container_name, path = self.get_storage_info(path)
info, backups = swift.get_container(container_name, prefix=path)
backups = sorted(
map(lambda x: int(x["name"].rsplit("/", 1)[-1]), backups))
elif self.storage.type == "s3":