From 86e04c00dbcaa6906ca559c732544632f365d092 Mon Sep 17 00:00:00 2001 From: Pengju Jiao Date: Sat, 12 Aug 2017 08:14:18 +0800 Subject: [PATCH] Fix creating swift container error Specify the swift storage as 'abc/123', it will fail when 'abc' was not exist. This patch will fix it. Change-Id: Id11d632741bbfc8da8ccb6180374fb6da59d32da Closes-Bug: #1688442 --- freezer/storage/swift.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freezer/storage/swift.py b/freezer/storage/swift.py index e2fb35de..27d0f6ae 100644 --- a/freezer/storage/swift.py +++ b/freezer/storage/swift.py @@ -129,8 +129,9 @@ class SwiftStorage(physical.PhysicalStorage): account. """ containers_list = [c['name'] for c in self.swift().get_account()[1]] - if self.storage_path not in containers_list: - self.swift().put_container(self.storage_path) + container_name = self.storage_path.split('/', 1)[0] + if container_name not in containers_list: + self.swift().put_container(container_name) def info(self): containers = self.swift().get_account()[1]