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
This commit is contained in:
Eric Peterson 2017-01-23 10:39:52 -07:00
parent f06a4ecbfa
commit 90a9af2e0b

View File

@ -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)