Merge "Fix: failed to create snapshot with DriverFilter" into stable/train

This commit is contained in:
Zuul 2020-04-27 11:39:28 +00:00 committed by Gerrit Code Review
commit 0aceffbf9e
1 changed files with 6 additions and 1 deletions

View File

@ -287,7 +287,12 @@ class FilterScheduler(driver.Scheduler):
# takes 'resource_XX' and 'volume_XX' as input respectively, copying
# 'volume_XX' to 'resource_XX' will make both filters happy.
volume_type = request_spec.get("volume_type")
resource_type = volume_type if volume_type is not None else {}
# When creating snapshots, the value of volume_type is None here
# which causes issues in filters (Eg: Bug #1856126).
# To prevent that, we set it as an empty dictionary here.
if volume_type is None:
volume_type = {}
resource_type = volume_type
config_options = self._get_configuration_options()