From 90a9af2e0b4524b4dec1caafbb6159cb587878d4 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Mon, 23 Jan 2017 10:39:52 -0700 Subject: [PATCH] Autogenerate container name correctly for vol backup The volume backup code is passing '' as a default container name, which will cause cinder/swift to fail. If no container name is provided, the default value of None will enable the auto creation of a container correctly. Change-Id: I7813153c65652ce6e1a5ac03204a8738eefdc64e Closes-Bug: #1658137 --- openstack_dashboard/api/cinder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/api/cinder.py b/openstack_dashboard/api/cinder.py index cc7c46652b..f50df734f4 100644 --- a/openstack_dashboard/api/cinder.py +++ b/openstack_dashboard/api/cinder.py @@ -669,9 +669,12 @@ def volume_backup_create(request, container_name, name, description): + # need to ensure the container name is not an empty + # string, but pass None to get the container name + # generated correctly backup = cinderclient(request).backups.create( volume_id, - container=container_name, + container=container_name if container_name else None, name=name, description=description) return VolumeBackup(backup)